Commit 983977d
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 983977d
File tree
2 files changed
+20
-1
lines changed- src/graphql/error
- tests/execution
2 files changed
+20
-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 | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
| 394 | + | |
394 | 395 | | |
395 | 396 | | |
396 | 397 | | |
| |||
410 | 411 | | |
411 | 412 | | |
412 | 413 | | |
| 414 | + | |
413 | 415 | | |
414 | 416 | | |
415 | 417 | | |
416 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
417 | 424 | | |
418 | 425 | | |
419 | 426 | | |
| |||
448 | 455 | | |
449 | 456 | | |
450 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
451 | 461 | | |
452 | 462 | | |
453 | 463 | | |
| |||
470 | 480 | | |
471 | 481 | | |
472 | 482 | | |
| 483 | + | |
473 | 484 | | |
474 | 485 | | |
475 | 486 | | |
| |||
518 | 529 | | |
519 | 530 | | |
520 | 531 | | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
521 | 537 | | |
522 | 538 | | |
523 | 539 | | |
| |||
0 commit comments