Skip to content

Commit a4afaeb

Browse files
committedDec 2, 2019
Don't log traceback for explicit error response from mutation
1 parent 452f648 commit a4afaeb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed
 

‎graphql/execution/executor.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -448,12 +448,13 @@ def resolve_or_error(
448448
try:
449449
return executor.execute(resolve_fn, source, info, **args)
450450
except Exception as e:
451-
logger.exception(
452-
"An error occurred while resolving field {}.{}".format(
453-
info.parent_type.name, info.field_name
451+
if not isinstance(e, GraphQLError):
452+
logger.exception(
453+
"An error occurred while resolving field {}.{}".format(
454+
info.parent_type.name, info.field_name
455+
)
454456
)
455-
)
456-
e.stack = sys.exc_info()[2] # type: ignore
457+
e.stack = sys.exc_info()[2] # type: ignore
457458
return e
458459

459460

0 commit comments

Comments
 (0)