500 Error handling suggestions
See original GitHub issueThe way 500 errors are currently handled is that exceptions are caught and GraphQL sends the literal error message back to the consumer in the error response, such as "message": "foo is not a function"
and the error trace is swallowed. Instead, it would be preferable if it were a generic message, such as Internal Server Error
, and the error were logged.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:13
Top Results From Across the Web
How to Fix a 500 Internal Server Error - Lifewire
The 500 Internal Server Error is a very general HTTP status code that means something has gone wrong on the website's server, but...
Read more >How to handle 500 http errors - Stack Overflow
If you want to retrieve the response data, you need to use something like dataTask(with:completionHandler:) to send your request. That function ...
Read more >HTTP 500 Internal Server Error: What It Means & How to Fix It
An HTTP 500 internal server error is a general error message. It covers unexpected issues that don't fit into existing error codes. HTTP...
Read more >Best Practices for REST API Error Handling - Baeldung
500 errors signal that some issues or exceptions occurred on the server while handling a request.
Read more >Error Handling - OWASP Cheat Sheet Series
Error handling is a part of the overall security of an application. ... HTTP Status 500 - For input string: "null" type Exception...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think helix should only handle unexpected errors. E.g. if the schema is invalid or undefined etc or execute throws an error for some unknown reason
@dburles We could introduce a safe by default error handler function that can be overwritten. The default implementation could simply map the error message to
Internal server error
and print the original error to the console with console.error? If people want to customize behavior they can override it. @dotansimha What do you think?