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

Introduce ClientSafeModelNotFoundException for @can and @canFind directives #2522

Merged
merged 3 commits into from
Mar 11, 2024

Conversation

ChaplyginWezom
Copy link
Contributor

Resolves #2521

  • Added or updated tests
  • Documented user facing changes
  • Updated CHANGELOG.md

Changes

Added custom ClientSafeModelNotFoundException to wrap around ModelNotFoundException in @can and @canFind directives.
New exception is linked to previous exception, allowing for usage in custom error handlers. With this change developers could be able to modify original exception how they want, formatting or replacing conditionally

Breaking changes

Probably none, as new exception being safely catched into same GraphQL\Error and maintain original message

@spawnia spawnia added the enhancement A feature or improvement label Mar 10, 2024
@ChaplyginWezom
Copy link
Contributor Author

Ok, so I've extended ModelNotFoundException and now mention of previous exception is redundant

@spawnia spawnia merged commit dffb9c6 into nuwave:master Mar 11, 2024
31 of 32 checks passed
@spawnia
Copy link
Collaborator

spawnia commented Mar 11, 2024

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants