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

feature(core): Add module context name to UnknownDependenciesMessage #1143

Conversation

BrunnerLivio
Copy link
Member

@BrunnerLivio BrunnerLivio commented Oct 2, 2018

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

The error when a injection dependency is missing does not show from which Module it is talking about

Issue Number: N/A

What is the new behavior?

It tries to parse the current module context name and shows the error message (note the CatsModule in the message):

[Nest] 20205   - 2018-10-2 11:56:51   [ExceptionHandler] Nest can't resolve dependencies of the CatsController (?). Please make sure that the argument at index [0] is available in the CatsModule context. +27ms

In case the module name can not be parsed somehow, it will use the string 'current' as fallback name for the module, as it used to be.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

@BrunnerLivio BrunnerLivio force-pushed the feature/print-context-injection-error branch from 8bf95c6 to 4e943db Compare October 2, 2018 10:07
@coveralls
Copy link

Coverage Status

Coverage remained the same at 93.67% when pulling 4e943db on BrunnerLivio:feature/print-context-injection-error into 65bb7e7 on nestjs:master.

@kamilmysliwiec
Copy link
Member

Great job 💪

@anodynos
Copy link

anodynos commented Oct 7, 2018

Any chance to merge & publish this PR? I'm facing a #861 :-(

@BrunnerLivio
Copy link
Member Author

Is there anything blocking or can this be merged into the 5.4.0 branch? @kamilmysliwiec

@kamilmysliwiec kamilmysliwiec merged commit 6eec601 into nestjs:master Oct 19, 2018
@lock
Copy link

lock bot commented Sep 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants