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

INJECUTE_NAMESPACE_RESULT ​

A namespace callback returned something other than a new container.

How to fix it ​

Return the registry the callback received (after adding services), a fork of it, or a new DIContainer.

Handling it in code ​

ts
import { InjecuteError } from 'injecute';

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

All error codes

Released under the MIT License.