code: def on_error(exe_context, info, catch_error, e):
      error = e
      if not isinstance(e, (GraphQLLocatedError, GraphQLError)):
          error = GraphQLLocatedError(info.field_asts, original_error=e)
      if catch_error:
          exe_context.errors.append(error)
          executor.logger.exception(
              "An error occurred while resolving field {}.{}".format(
                  info.parent_type.name, info.field_name
              )
          )
          error.stack = sys.exc_info()[2]
          return None
      raise error
  
imports: import sys
  from collections.abc import Iterable
  from functools import partial
  from wandb_promise import Promise, is_thenable
  from ...error import GraphQLError, GraphQLLocatedError
  from ...type import GraphQLEnumType, GraphQLInterfaceType, GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLScalarType, GraphQLUnionType
  from ..base import default_resolve_fn
  from ...execution import executor
  from .utils import imap, normal_map
label_desc: Use image node_id 8 for calling a global function with example usage: on_error(exe_context, info, catch_error, e) and returns: None