Skip to content

Commit 2aa6129

Browse files
committed
Don't log traceback for explicit error response from mutation
1 parent 37b9434 commit 2aa6129

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
@@ -445,12 +445,13 @@ def resolve_or_error(
445445
try:
446446
return executor.execute(resolve_fn, source, info, **args)
447447
except Exception as e:
448-
logger.exception(
449-
"An error occurred while resolving field {}.{}".format(
450-
info.parent_type.name, info.field_name
448+
if not isinstance(e, GraphQLError):
449+
logger.exception(
450+
"An error occurred while resolving field {}.{}".format(
451+
info.parent_type.name, info.field_name
452+
)
451453
)
452-
)
453-
e.stack = sys.exc_info()[2] # type: ignore
454+
e.stack = sys.exc_info()[2] # type: ignore
454455
return e
455456

456457

0 commit comments

Comments
 (0)