-
Notifications
You must be signed in to change notification settings - Fork 182
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
Unable to locate original location of Exception #207
Comments
Thanks for taking the time to post this and contribute a solution! I don't have any insight on the problem at hand directly (your code looks good!) but one small problem you'll need to look into when doing a PR is compatibility with Python 2. You probably want to be using https://pythonhosted.org/six/#six.raise_from instead of If we fix compatibility I don't know of any bad side effects, so if it helps you its probably useful and deserves a PR! |
Unfortunately, @Drarok's solution didn't work for me. It is incredibly frustrating not having a stack trace in the logs. |
@feus4177 def handle_error(error):
import traceback; traceback.print_tb(error.original_error.__traceback__) # this line has been inserted
# type: (Union[GraphQLError, GraphQLLocatedError]) -> Optional[Any]
traceback = completed._traceback # type: ignore
exe_context.report_error(error, traceback)
return None and it now prints stack traces. |
In executor.py, there is the following code:
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: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!
The text was updated successfully, but these errors were encountered: