Skip to content

Add exception logging #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions graphql/core/execution/executor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import collections
import functools
import logging

from ..error import GraphQLError
from ..language import ast
Expand All @@ -14,6 +15,9 @@
get_field_def, get_operation_root_type


logger = logging.getLogger(__name__)


class Executor(object):
def __init__(self, execution_middlewares=None, default_resolver=default_resolve_fn, map_type=dict):
assert issubclass(map_type, collections.MutableMapping)
Expand Down Expand Up @@ -317,4 +321,6 @@ def resolve_or_error(self, resolve_fn, source, args, info):

return curried_resolve_fn()
except Exception as e:
logger.exception("An error occurred while resolving field %s.%s"
% (info.parent_type.name, info.field_name))
return e