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

feat(core): disambiguate string-based providers from class-based providers on error message #12445

Conversation

micalevisk
Copy link
Member

@micalevisk micalevisk commented Sep 24, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • 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?

when some provider registered with a string token is missing, the error message is the same as the ones registered with classes

I believe this confuse people sometimes specially when the token is created by 3rd-party libs and, on the consumer side, there is a class with the same name

For example:

image
image

What is the new behavior?

image

I believe that this minor change would decrease the debugging time spent of resolving such errors. But I don't know if not having quotes around provider's name was intentional in first place.

Does this PR introduce a breaking change?

  • Yes
  • No(?)

@micalevisk micalevisk force-pushed the feat/disambiguate-provider-token-on-error branch from 1b1e572 to 80e0a99 Compare September 24, 2023 16:18
@coveralls
Copy link

coveralls commented Sep 24, 2023

Pull Request Test Coverage Report for Build 037e170e-ef40-47ee-be06-a135c07aa6ba

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.639%

Totals Coverage Status
Change from base Build fe06fc66-4e13-4e12-b2d5-e4752da0ecad: 0.0%
Covered Lines: 6469
Relevant Lines: 6983

💛 - Coveralls

@micalevisk micalevisk force-pushed the feat/disambiguate-provider-token-on-error branch from 80e0a99 to 95e3537 Compare September 24, 2023 16:47
@micalevisk micalevisk force-pushed the feat/disambiguate-provider-token-on-error branch from 95e3537 to 18fbf27 Compare September 25, 2023 01:49
@kamilmysliwiec kamilmysliwiec merged commit f3339a3 into nestjs:master Oct 23, 2023
4 checks passed
@kamilmysliwiec
Copy link
Member

LGTM

@micalevisk micalevisk deleted the feat/disambiguate-provider-token-on-error branch October 23, 2023 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants