GraphQL icon indicating copy to clipboard operation
GraphQL copied to clipboard

All exceptions are caught

Open robertvansteen opened this issue 8 years ago • 4 comments

Why are all the exceptions caught? This makes debugging really difficult, because there will be no logs or for example in my Symfony application nothing shows up in the profiler. Am I missing something here?

robertvansteen avatar Dec 19 '16 10:12 robertvansteen

@rovansteen Will let it slip in Symfony bundle. Ideally – exceptions will be delivered with the descriptive information so you can easily see what's the problem is. That was a big topic of discussion and idea was to return response in any case... but again, we have to keep the original exception message if it's generic.

viniychuk avatar Dec 21 '16 04:12 viniychuk

@viniychuk yes I understand that. Perhaps having some sort of middleware where you can do something with the exception, like log it or send it to a service like Sentry will help with debugging a lot while still being able to send a useful response back to the client.

robertvansteen avatar Dec 23 '16 11:12 robertvansteen

Just a workaround: I've written my own ExecutionContext class and invoke it via the given parameter "graphql.execution_context.class". This way I can override the "addError" method and log accordingly.

garte avatar Feb 20 '17 16:02 garte

This issue makes testing and debugging really difficult. It seems like there are lots of places where \Exception is caught. Perhaps a pluggable exception handler would be a good way of dealing with the problem?

lox avatar Apr 12 '17 06:04 lox