Repository navigation
Preserve the suppressed context of an original error - #320
Open
cheapsteak wants to merge 1 commit into
Open
cheapsteak wants to merge 1 commit into
cheapsteak wants to merge 1 commit into
Conversation
GraphQLError copied the context of an original error but not its __suppress_context__ flag, so an error raised "from None" got its hidden context back when it was wrapped, e.g. by located_error. Fixes graphql-python#319 Claude-Session: https://claude.ai/code/session_01R8Hmf6XiRffNRSfDMNSFjh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #319
GraphQLError.__init__copiedoriginal_error.__context__but notoriginal_error.__suppress_context__. So an error raisedfrom Nonegot its hidden context back when it was wrapped, for example bylocated_errorfor every resolver error. This change copies the flag together with the context.Tests
passes_the_suppressed_context_of_an_original_errorintests/error/test_graphql_error.py. It fails without the change and passes with it.pytest tests: 3822 passed, 18 skipped.ruff check,ruff format --checkandmypypass on the changed files.Disclosure: this pull request was written by Claude (Anthropic's AI assistant, via Claude Code) on behalf of @cheapsteak, who reviewed it and takes responsibility for the change.