Commit 1f63309
committed
Fix AttributeError on exception with field
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
```source
1 parent fa8f9b5 commit 1f63309
File tree
2 files changed
+12
-1
lines changed- src/graphql/error
- tests/error
2 files changed
+12
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
0 commit comments