Skip to content

Error masking and internals leaking in error handling #209

Open

Description

@ods

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:

Activity

  1. cobalamin commented on Oct 7, 2018

    @cobalamin

    This has been bugging me a lot, since I want to raise and catch my own Exception subclasses for some occasions in my app. This library currently makes this impossible, without changing the code in the library itself too.

    Using except Exception as e has pretty much never been a good idea :/ But looking through the code, I see it pop up in a lot of places, so I wasn't sure where to start. @ods I saw that you changed a lot (maybe all) of it in your linked commit f81ca08. Did this fix it completely for you?

  2. ods commented on Oct 8, 2018

    @ods
    Author

    Did this fix it completely for you?

    Yes, it did so far. There are actually two commits in my fork: second is to silence annoying noise in logs. I'm going to issue a pull request after some time of using it in our project.

  3. ods commented on Oct 17, 2018

    @ods
    Author

    Pull request: #211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions