Fix AttributeError on exception with field `source`
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
```