diff --git a/graphql/error/located_error.py b/graphql/error/located_error.py index c095ea17..87ded24e 100644 --- a/graphql/error/located_error.py +++ b/graphql/error/located_error.py @@ -13,7 +13,7 @@ def __init__(self, nodes, original_error=None): else: message = 'An unknown error occurred.' - if isinstance(original_error, GraphQLError): + if hasattr(original_error, 'stack'): stack = original_error.stack else: stack = sys.exc_info()[2] diff --git a/graphql/execution/executor.py b/graphql/execution/executor.py index 313a3e10..08ffa818 100644 --- a/graphql/execution/executor.py +++ b/graphql/execution/executor.py @@ -1,6 +1,7 @@ import collections import functools import logging +import sys from promise import Promise, is_thenable, promise_for_dict, promisify @@ -170,6 +171,7 @@ def resolve_or_error(resolve_fn, source, args, context, info, executor): logger.exception("An error occurred while resolving field {}.{}".format( info.parent_type.name, info.field_name )) + e.stack = sys.exc_info()[2] return e