Skip to content

Fix AttributeError on exception with field source #240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kimjh12
Copy link

@kimjh12 kimjh12 commented Aug 21, 2025

trying to fix below error, which happens if the handler raises an custom exception with source field inside

            locations: list[SourceLocation] | None = [
>               source.get_location(pos) for pos in positions
                ^^^^^^^^^^^^^^^^^^^
            ]
E           AttributeError: 'str' object has no attribute 'get_location'

.tox/py312/lib/python3.12/site-packages/graphql/error/graphql_error.py:161: AttributeError

trying to fix below error, which happens if the handler raises an
custom exception with `source` field inside

```
            locations: list[SourceLocation] | None = [
>               source.get_location(pos) for pos in positions
                ^^^^^^^^^^^^^^^^^^^
            ]
E           AttributeError: 'str' object has no attribute 'get_location'

.tox/py312/lib/python3.12/site-packages/graphql/error/graphql_error.py:161: AttributeError
```
@kimjh12 kimjh12 requested a review from Cito as a code owner August 21, 2025 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant