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

Resolver: better exception message #233

Merged
merged 3 commits into from Feb 28, 2020
Merged

Resolver: better exception message #233

merged 3 commits into from Feb 28, 2020

Conversation

janbarasek
Copy link
Contributor

@janbarasek janbarasek commented Feb 26, 2020

  • bug fix
  • BC break? no

In case of neon file:

services:
   tagManagerAccessor:
      factory: Namespace\TagManagerAccessor

Nette throws user unfriendly exception:

Class 'Namespace\TagManagerAccessor' not found.

I think if the class does not exist, but the interface does, Nette should throw more user-friendly exception like:

Service 'tagManagerAccessor': Class 'Namespace\TagManagerAccessor' not found. Interface 'Namespace\TagManagerAccessor' can not be used in 'factory' section as service.

Thanks.

@dg
Copy link
Member

@dg dg commented Feb 28, 2020

I don't like part Class 'Namespace\TagManagerAccessor' not found.

What about Interface 'Namespace\TagManagerAccessor' can not be used as 'factory', did you mean 'implement'?

@janbarasek
Copy link
Contributor Author

@janbarasek janbarasek commented Feb 28, 2020

@dg Your message makes sense. Implemented.

@dg
Copy link
Member

@dg dg commented Feb 28, 2020

Thanks

@dg dg changed the title Resolver: In case of factory: interface throw user-friendly exception message Resolver: better exception message Feb 28, 2020
@dg dg merged commit 9d0fba9 into nette:master Feb 28, 2020
9 checks passed
dg pushed a commit that referenced this issue Feb 28, 2020
dg pushed a commit that referenced this issue Feb 28, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants