From a4afaebbffb98cfa49d2000088aaedb947b07705 Mon Sep 17 00:00:00 2001 From: Denis Otkidach Date: Mon, 29 Jul 2019 15:50:29 +0300 Subject: [PATCH] Don't log traceback for explicit error response from mutation --- graphql/execution/executor.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/graphql/execution/executor.py b/graphql/execution/executor.py index 29487b2d..8cb330b1 100644 --- a/graphql/execution/executor.py +++ b/graphql/execution/executor.py @@ -448,12 +448,13 @@ def resolve_or_error( try: return executor.execute(resolve_fn, source, info, **args) except Exception as e: - logger.exception( - "An error occurred while resolving field {}.{}".format( - info.parent_type.name, info.field_name + if not isinstance(e, GraphQLError): + logger.exception( + "An error occurred while resolving field {}.{}".format( + info.parent_type.name, info.field_name + ) ) - ) - e.stack = sys.exc_info()[2] # type: ignore + e.stack = sys.exc_info()[2] # type: ignore return e