There are several places (execute_graphql(), complete_value(), complete_value_catching_error(), resolve_or_error(), execute() ExecutionContext.report_error(), may be there is more) where the library indiscriminately catches all exceptions and reports them to client. It's correct behaviour for parsing/usage errors. But for programming and runtime errors there are problems:
- original error is lost and traceback is not reported, so it becomes hard to debug;
- potentially sensitive information is leaked to client via error message.
I believe the the right behaviour would be to catch and report to client specific exceptions only (GraphQLError and subclasses?) while propagating the rest.
Related issues:
There are several places (
execute_graphql(),complete_value(),complete_value_catching_error(),resolve_or_error(),execute()ExecutionContext.report_error(), may be there is more) where the library indiscriminately catches all exceptions and reports them to client. It's correct behaviour for parsing/usage errors. But for programming and runtime errors there are problems:I believe the the right behaviour would be to catch and report to client specific exceptions only (
GraphQLErrorand subclasses?) while propagating the rest.Related issues: