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

Report non client-safe errors through Laravel's ExceptionHandler #1303 #1303

Merged
merged 9 commits into from
Apr 19, 2020

Conversation

spawnia
Copy link
Collaborator

@spawnia spawnia commented Apr 18, 2020

  • Added or updated tests
  • Added Docs for all relevant versions
  • Updated CHANGELOG.md

Resolves #1026

Changes

Propagate the reporting of error that occur within GraphQL execution to Laravel's default ExceptionHandler.

Thanks to @olivernybroe for this idea in #1026 (comment)

Breaking changes

No

@spawnia
Copy link
Collaborator Author

spawnia commented Apr 19, 2020

I am not sure which errors should be reported by default and how we can differentiate between them.

It does seem unnecessary to report syntax errors in client queries and validation errors. On the other hand, it might be useful to report errors where someone might try to attack the server, such as authorization errors or when somebody triggers the complexity limitation repeatedly.

@stayallive
Copy link
Collaborator

Could a possible option be to only report errors that are not client safe? If they're client safe we can assume the client should be able to handle them, however that would mean that complexity errors for example are not reported since they're considered client safe. But there might not be a good criteria on what to do or not report, so going for client safe could be a safe one and if you need more you can add your own error handler reporting those (or replace this reporting handler altogether with one with custom logic).

@spawnia spawnia changed the title Add error handler that reports to Laravel's ExceptionHandler Report errors that are not client-safe through Laravel's ExceptionHandler Apr 19, 2020
Copy link
Collaborator

@stayallive stayallive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change 👍

@spawnia spawnia changed the title Report errors that are not client-safe through Laravel's ExceptionHandler Report non client-safe errors through Laravel's ExceptionHandler #1303 Apr 19, 2020
@spawnia spawnia merged commit 7774ce2 into master Apr 19, 2020
@spawnia spawnia deleted the report-errors branch April 19, 2020 14:12
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.

Allow to write logs on production
2 participants