Skip to content

Commit e398c53

Browse files
committed
Only use existing stack if the error has one.
1 parent 7ad0795 commit e398c53

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

graphql/error/located_error.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ def __init__(self, nodes, original_error=None):
1313
else:
1414
message = 'An unknown error occurred.'
1515

16-
stack = original_error.stack
16+
if hasattr(original_error, 'stack'):
17+
stack = original_error.stack
18+
else:
19+
stack = sys.exc_info()[2]
1720

1821
super(GraphQLLocatedError, self).__init__(
1922
message=message,

0 commit comments

Comments
 (0)