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

INJECUTE_INVALID_OPTION ​

An option is not supported here.

How to fix it ​

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".

Handling it in code ​

ts
import { InjecuteError } from 'injecute';

try {
  // ...
} catch (error) {
  if (error instanceof InjecuteError && error.code === 'INJECUTE_INVALID_OPTION') {
    // error.message explains what happened; error.path is the resolution chain
  }
}

All error codes

Released under the MIT License.