Documents injecute 1.x · Migrating from 0.x
Skip to content

Class: InjecuteError ​

Defined in: src/errors.ts:43

The error injecute throws. code is stable (safe to branch on), message explains what happened and how to fix it, path shows the resolution chain, and docs links to the error's page.

Example ​

ts
try {
  app.get('users');
} catch (error) {
  if (error instanceof InjecuteError && error.code === 'INJECUTE_NOT_REGISTERED') {
    // ...
  }
}

Extends ​

  • Error

Extended by ​

Constructors ​

Constructor ​

new InjecuteError(code, message, options?): InjecuteError

Defined in: src/errors.ts:53

Parameters ​

code ​

"INJECUTE_NOT_REGISTERED" | "INJECUTE_ALREADY_REGISTERED" | "INJECUTE_CIRCULAR_DEPENDENCY" | "INJECUTE_NOTHING_TO_REPLACE" | "INJECUTE_NO_PREVIOUS_DEFINITION" | "INJECUTE_INVALID_FACTORY" | "INJECUTE_INVALID_DEPENDENCY" | "INJECUTE_CLASS_NOT_CONSTRUCTED" | "INJECUTE_RESOLUTION_FAILED" | "INJECUTE_NOT_A_FUNCTION" | "INJECUTE_NAMESPACE_CONFLICT" | "INJECUTE_NAMESPACE_RESULT" | "INJECUTE_EXTENSION_RESULT" | "INJECUTE_SEALED" | "INJECUTE_DISPOSED" | "INJECUTE_DISPOSE_FAILED" | "INJECUTE_WIRING_FAILED" | "INJECUTE_INVALID_OPTION" | "INJECUTE_UNKNOWN_EVENT" | "INJECUTE_READ_ONLY" | "INJECUTE_INVALID_HOOK" | "INJECUTE_UNDO_FAILED" | "INJECUTE_LIFECYCLE_STOPPED"

message ​

string

options? ​

InjecuteErrorOptions = {}

Returns ​

InjecuteError

Overrides ​

Error.constructor

Properties ​

cause? ​

optional cause?: unknown

Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:24

Inherited from ​

Error.cause


code ​

readonly code: "INJECUTE_NOT_REGISTERED" | "INJECUTE_ALREADY_REGISTERED" | "INJECUTE_CIRCULAR_DEPENDENCY" | "INJECUTE_NOTHING_TO_REPLACE" | "INJECUTE_NO_PREVIOUS_DEFINITION" | "INJECUTE_INVALID_FACTORY" | "INJECUTE_INVALID_DEPENDENCY" | "INJECUTE_CLASS_NOT_CONSTRUCTED" | "INJECUTE_RESOLUTION_FAILED" | "INJECUTE_NOT_A_FUNCTION" | "INJECUTE_NAMESPACE_CONFLICT" | "INJECUTE_NAMESPACE_RESULT" | "INJECUTE_EXTENSION_RESULT" | "INJECUTE_SEALED" | "INJECUTE_DISPOSED" | "INJECUTE_DISPOSE_FAILED" | "INJECUTE_WIRING_FAILED" | "INJECUTE_INVALID_OPTION" | "INJECUTE_UNKNOWN_EVENT" | "INJECUTE_READ_ONLY" | "INJECUTE_INVALID_HOOK" | "INJECUTE_UNDO_FAILED" | "INJECUTE_LIFECYCLE_STOPPED"

Defined in: src/errors.ts:47

Stable identifier of the error.


docs ​

readonly docs: string

Defined in: src/errors.ts:51

Link to the documentation page of this error.


message ​

message: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1075

Inherited from ​

Error.message


name ​

readonly name: string = 'InjecuteError'

Defined in: src/errors.ts:45

'InjecuteError' (or the subclass name).

Overrides ​

Error.name


path ​

readonly path: readonly ServiceKey[]

Defined in: src/errors.ts:49

Service keys being resolved when the error happened, outermost first.


stack? ​

optional stack?: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from ​

Error.stack

Released under the MIT License.