Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More descriptive message for 'Tried to override * which is not registered' error #6

Open
aleksfront opened this issue Feb 6, 2023 · 0 comments

Comments

@aleksfront
Copy link

Current error message is

Tried to override "my-injectable" which is not registered.

      125 |     di = getDiForUnitTesting({ doGeneralOverrides: true });
      126 |
    > 127 |     di.override(my-injectable, () => [
          |        ^
      128 |       acmeGroup,
      129 |       orgA,
      130 |       teamA,

      at Object.override (node_modules/@ogre-tools/injectable/build/index.js:1:3041)

Most of the time in my case the error caused by invalid injectable filename: it was my-injectable.ts. And it should be my.injectable.ts.

So I suggest to add little advice like so:

Tried to override "my-injectable" which is not registered. Please check the filename, it must contain "*.injectable.ts`. Or something similar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant