Skip to content

Commit 943a08e

Browse files
committed
Don't log traceback for explicit error response from mutation
1 parent 6720944 commit 943a08e

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
@@ -450,12 +450,13 @@ def resolve_or_error(
450450
try:
451451
return executor.execute(resolve_fn, source, info, **args)
452452
except Exception as e:
453-
logger.exception(
454-
"An error occurred while resolving field {}.{}".format(
455-
info.parent_type.name, info.field_name
453+
if not isinstance(e, GraphQLError):
454+
logger.exception(
455+
"An error occurred while resolving field {}.{}".format(
456+
info.parent_type.name, info.field_name
457+
)
456458
)
457-
)
458-
e.stack = sys.exc_info()[2] # type: ignore
459+
e.stack = sys.exc_info()[2] # type: ignore
459460
return e
460461

461462

0 commit comments

Comments
 (0)