Variable: errorCodes
consterrorCodes:object
Defined in: src/error-codes.ts:10
Every error injecute throws, with a short title and how to fix it. The docs pages under /errors/<slug> are generated from this list.
Type Declaration
INJECUTE_ALREADY_REGISTERED
readonlyINJECUTE_ALREADY_REGISTERED:object
INJECUTE_ALREADY_REGISTERED.hint
readonlyhint:"Pass { replace: true } to replace the registration, or use another key. In a fork, { replace: true } is needed to override a parent's key too, and the override reaches only services resolved in the fork: services registered in the parent keep the parent's one. To replace it for every service, use fork({ isolated: true })."="Pass { replace: true } to replace the registration, or use another key. In a fork, { replace: true } is needed to override a parent's key too, and the override reaches only services resolved in the fork: services registered in the parent keep the parent's one. To replace it for every service, use fork({ isolated: true })."
INJECUTE_ALREADY_REGISTERED.title
readonlytitle:"The key is already registered in this container or a parent"='The key is already registered in this container or a parent'
INJECUTE_CIRCULAR_DEPENDENCY
readonlyINJECUTE_CIRCULAR_DEPENDENCY:object
INJECUTE_CIRCULAR_DEPENDENCY.hint
readonlyhint:"Break the cycle: extract the shared part into its own service, or resolve one side lazily with a function dependency (() => container.get(key))."='Break the cycle: extract the shared part into its own service, or resolve one side lazily with a function dependency (() => container.get(key)).'
INJECUTE_CIRCULAR_DEPENDENCY.title
readonlytitle:"Services depend on each other in a cycle"='Services depend on each other in a cycle'
INJECUTE_CLASS_NOT_CONSTRUCTED
readonlyINJECUTE_CLASS_NOT_CONSTRUCTED:object
INJECUTE_CLASS_NOT_CONSTRUCTED.hint
readonlyhint:"Classes compiled to ES5 (Babel for old browsers, TypeScript target: es5) and bound classes cannot be detected. Register them with construct(MyClass)."='Classes compiled to ES5 (Babel for old browsers, TypeScript target: es5) and bound classes cannot be detected. Register them with construct(MyClass).'
INJECUTE_CLASS_NOT_CONSTRUCTED.title
readonlytitle:"A class was called without new"='A class was called without new'
INJECUTE_DISPOSE_FAILED
readonlyINJECUTE_DISPOSE_FAILED:object
INJECUTE_DISPOSE_FAILED.hint
readonlyhint:"Every other service was still disposed. The failures are in `cause` (an AggregateError)."='Every other service was still disposed. The failures are in `cause` (an AggregateError).'
INJECUTE_DISPOSE_FAILED.title
readonlytitle:"Some services failed to dispose"='Some services failed to dispose'
INJECUTE_DISPOSED
readonlyINJECUTE_DISPOSED:object
INJECUTE_DISPOSED.hint
readonlyhint:"Create a new container (or fork) instead of using one after dispose()."='Create a new container (or fork) instead of using one after dispose().'
INJECUTE_DISPOSED.title
readonlytitle:"The container is disposed"='The container is disposed'
INJECUTE_EXTENSION_RESULT
readonlyINJECUTE_EXTENSION_RESULT:object
INJECUTE_EXTENSION_RESULT.hint
readonlyhint:"A module function must return the registry it received (after adding services) or a fork of it."='A module function must return the registry it received (after adding services) or a fork of it.'
INJECUTE_EXTENSION_RESULT.title
readonlytitle:"An extension returned a container that is not this one or its child"='An extension returned a container that is not this one or its child'
INJECUTE_INVALID_DEPENDENCY
readonlyINJECUTE_INVALID_DEPENDENCY:object
INJECUTE_INVALID_DEPENDENCY.hint
readonlyhint:"Dependencies are service keys, optional(key), collect(tag) with a tag made by createTag(), or functions that return the value."='Dependencies are service keys, optional(key), collect(tag) with a tag made by createTag(), or functions that return the value.'
INJECUTE_INVALID_DEPENDENCY.title
readonlytitle:"A dependency is not a key, optional(key), collect(tag) or a function"='A dependency is not a key, optional(key), collect(tag) or a function'
INJECUTE_INVALID_FACTORY
readonlyINJECUTE_INVALID_FACTORY:object
INJECUTE_INVALID_FACTORY.hint
readonlyhint:"Pass a function that creates the service, a class, or use addInstance() for a ready value."='Pass a function that creates the service, a class, or use addInstance() for a ready value.'
INJECUTE_INVALID_FACTORY.title
readonlytitle:"The factory is not a function or class"='The factory is not a function or class'
INJECUTE_INVALID_HOOK
readonlyINJECUTE_INVALID_HOOK:object
INJECUTE_INVALID_HOOK.hint
readonlyhint:"A key that ends with `:<stage>` is a lifecycle hook. Register it with addSingleton() under `lifecycle.<stage>(name)`, and let it depend on services, never on other hooks: order hooks with stages. Rename a key that is not meant as a hook."='A key that ends with `:<stage>` is a lifecycle hook. Register it with addSingleton() under `lifecycle.<stage>(name)`, and let it depend on services, never on other hooks: order hooks with stages. Rename a key that is not meant as a hook.'
INJECUTE_INVALID_HOOK.title
readonlytitle:"A lifecycle hook is not registered correctly"='A lifecycle hook is not registered correctly'
INJECUTE_INVALID_OPTION
readonlyINJECUTE_INVALID_OPTION:object
INJECUTE_INVALID_OPTION.hint
readonlyhint: "Transient services are not kept by the container, so they cannot have a dispose option. createTag() and createLifecycle() take unique, non-empty names without \":\" or \".\"; startLifecycle() takes a lifecycle made by createLifecycle() and only its stages in \"concurrent\"." ='Transient services are not kept by the container, so they cannot have a dispose option. createTag() and createLifecycle() take unique, non-empty names without ":" or "."; startLifecycle() takes a lifecycle made by createLifecycle() and only its stages in "concurrent".'
INJECUTE_INVALID_OPTION.title
readonlytitle:"An option is not supported here"='An option is not supported here'
INJECUTE_LIFECYCLE_STOPPED
readonlyINJECUTE_LIFECYCLE_STOPPED:object
INJECUTE_LIFECYCLE_STOPPED.hint
readonlyhint:"A lifecycle runs once per container. To start again, create a new container or an isolated fork."='A lifecycle runs once per container. To start again, create a new container or an isolated fork.'
INJECUTE_LIFECYCLE_STOPPED.title
readonlytitle:"The lifecycle of this container was stopped"='The lifecycle of this container was stopped'
INJECUTE_NAMESPACE_CONFLICT
readonlyINJECUTE_NAMESPACE_CONFLICT:object
INJECUTE_NAMESPACE_CONFLICT.hint
readonlyhint:"Choose another namespace name, or remove the service with that key."='Choose another namespace name, or remove the service with that key.'
INJECUTE_NAMESPACE_CONFLICT.title
readonlytitle:"The namespace name is already used by a service"='The namespace name is already used by a service'
INJECUTE_NAMESPACE_RESULT
readonlyINJECUTE_NAMESPACE_RESULT:object
INJECUTE_NAMESPACE_RESULT.hint
readonlyhint:"Return the registry the callback received (after adding services), a fork of it, or a new DIContainer."='Return the registry the callback received (after adding services), a fork of it, or a new DIContainer.'
INJECUTE_NAMESPACE_RESULT.title
readonlytitle:"A namespace callback returned something other than a new container"='A namespace callback returned something other than a new container'
INJECUTE_NO_PREVIOUS_DEFINITION
readonlyINJECUTE_NO_PREVIOUS_DEFINITION:object
INJECUTE_NO_PREVIOUS_DEFINITION.hint
readonlyhint:"A dependency on the key being registered resolves its previous definition (the replaced one, or the parent one). Register the original service first."='A dependency on the key being registered resolves its previous definition (the replaced one, or the parent one). Register the original service first.'
INJECUTE_NO_PREVIOUS_DEFINITION.title
readonlytitle:"A service depends on itself but there is nothing to decorate"='A service depends on itself but there is nothing to decorate'
INJECUTE_NOT_A_FUNCTION
readonlyINJECUTE_NOT_A_FUNCTION:object
INJECUTE_NOT_A_FUNCTION.hint
readonlyhint:"Only function services can be called with call(); use get() for other services."='Only function services can be called with call(); use get() for other services.'
INJECUTE_NOT_A_FUNCTION.title
readonlytitle:"call() was used on a service that is not a function"='call() was used on a service that is not a function'
INJECUTE_NOT_REGISTERED
readonlyINJECUTE_NOT_REGISTERED:object
INJECUTE_NOT_REGISTERED.hint
readonlyhint:"Register it (addSingleton / addTransient / addInstance) before resolving it, check the key for typos, or pass { optional: true } to get undefined instead."='Register it (addSingleton / addTransient / addInstance) before resolving it, check the key for typos, or pass { optional: true } to get undefined instead.'
INJECUTE_NOT_REGISTERED.title
readonlytitle:"No service is registered under this key"='No service is registered under this key'
INJECUTE_NOTHING_TO_REPLACE
readonlyINJECUTE_NOTHING_TO_REPLACE:object
INJECUTE_NOTHING_TO_REPLACE.hint
readonlyhint:"replace: true replaces a registration of this container or a parent. Nothing has this key, which usually means a registration is missing: a module that was not applied, or a typo in the key. Register the original first, or remove replace: true if this is the first registration."='replace: true replaces a registration of this container or a parent. Nothing has this key, which usually means a registration is missing: a module that was not applied, or a typo in the key. Register the original first, or remove replace: true if this is the first registration.'
INJECUTE_NOTHING_TO_REPLACE.title
readonlytitle:"A registration replaces a key that nothing is registered under"='A registration replaces a key that nothing is registered under'
INJECUTE_READ_ONLY
readonlyINJECUTE_READ_ONLY:object
INJECUTE_READ_ONLY.hint
readonlyhint:"Proxy accessors only read services. Register or replace services on the container."='Proxy accessors only read services. Register or replace services on the container.'
INJECUTE_READ_ONLY.title
readonlytitle:"The object is read-only"='The object is read-only'
INJECUTE_RESOLUTION_FAILED
readonlyINJECUTE_RESOLUTION_FAILED:object
INJECUTE_RESOLUTION_FAILED.hint
readonlyhint:"The original error is in `cause`; `path` shows which service needed it."='The original error is in `cause`; `path` shows which service needed it.'
INJECUTE_RESOLUTION_FAILED.title
readonlytitle:"A factory threw (or its promise rejected) while creating a service"='A factory threw (or its promise rejected) while creating a service'
INJECUTE_SEALED
readonlyINJECUTE_SEALED:object
INJECUTE_SEALED.hint
readonlyhint:"Register every service before seal(). To add services later (per request, per test), register them in a fork: app.fork().addInstance(...)."='Register every service before seal(). To add services later (per request, per test), register them in a fork: app.fork().addInstance(...).'
INJECUTE_SEALED.title
readonlytitle:"The container is sealed"='The container is sealed'
INJECUTE_UNDO_FAILED
readonlyINJECUTE_UNDO_FAILED:object
INJECUTE_UNDO_FAILED.hint
readonlyhint:"Its undo function threw, rejected, or did not finish before the stop signal aborted. The hook is in `path`, the original error in `cause`."='Its undo function threw, rejected, or did not finish before the stop signal aborted. The hook is in `path`, the original error in `cause`.'
INJECUTE_UNDO_FAILED.title
readonlytitle:"A lifecycle hook could not be undone"='A lifecycle hook could not be undone'
INJECUTE_UNKNOWN_EVENT
readonlyINJECUTE_UNKNOWN_EVENT:object
INJECUTE_UNKNOWN_EVENT.hint
readonlyhint:"Supported events: add, replace, reset, get, produce, dispose."='Supported events: add, replace, reset, get, produce, dispose.'
INJECUTE_UNKNOWN_EVENT.title
readonlytitle:"Unknown event name"='Unknown event name'
INJECUTE_WIRING_FAILED
readonlyINJECUTE_WIRING_FAILED:object
INJECUTE_WIRING_FAILED.hint
readonlyhint:"Every problem is listed in the message and in error.problems. Register the missing keys (check for typos and for modules that were not applied), and fix the factories that failed: their errors are in each problem and in cause (an AggregateError)."='Every problem is listed in the message and in error.problems. Register the missing keys (check for typos and for modules that were not applied), and fix the factories that failed: their errors are in each problem and in cause (an AggregateError).'
INJECUTE_WIRING_FAILED.title
readonlytitle:"The wiring check found services that are missing or fail"='The wiring check found services that are missing or fail'