graphql-python / graphql-python/graphql-core-legacy

Unable to locate original location of Exception

Abierto
#207 3 comentarios 3 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
372
Forks
175
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

In [executor.py](https://github.com/graphql-python/graphql-core/blob/master/graphql/execution/executor.py#L536), there is the following code:

```py
if isinstance(result, Exception):
raise GraphQLLocatedError(field_asts, original_error=result, path=path)
```

This appears to swallow the original error (`result`) as it doesn't appear in any tracebacks, leading me to lose my mind trying to work out where an error is actually being thrown. In my local install I have changed it to this in order to [chain the exceptions](https://www.python.org/dev/peps/pep-3134/):

```py
if isinstance(result, Exception):
raise GraphQLLocatedError(field_asts, original_error=result, path=path) from result
```

This gives me the full original exception's stack trace to look at when I'm debugging, and allows me to regain some sanity. I don't know if there any any knock-on effects though, which is why I didn't create this as a pull request. I'd love to hear your thoughts!

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Revisa graphql/execution/executor.py alrededor de la línea 536 y el comportamiento enlazado del encadenamiento de excepciones de PEP 3134. Comprueba si el resultado del encadenamiento conserva el comportamiento de GraphQLLocatedError y la salida del traceback, incluidos sus posibles efectos colaterales; se considerará completado cuando el cambio esté validado sin romper el manejo de errores existente.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
api, backend
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.