code: def complete_value_catching_error(
      exe_context, return_type, field_asts, info, result
  ):
      # If the field type is non-nullable, then it is resolved without any
      # protection from errors.
      if isinstance(return_type, GraphQLNonNull):
          return complete_value(
              exe_context, return_type, field_asts, info, result
          )
  
      # Otherwise, error protection is applied, logging the error and
      # resolving a null value for this field if one is encountered.
      try:
          completed = complete_value(
              exe_context, return_type, field_asts, info, result
          )
          if is_thenable(completed):
  
              def handle_error(error):
                  exe_context.errors.append(error)
                  return None
  
              return completed.catch(handle_error)
  
          return completed
      except Exception as e:
          exe_context.errors.append(e)
          return None
  
imports: import collections
  from collections.abc import Iterable
  import functools
  import logging
  import sys
  from wandb_promise import Promise, promise_for_dict, is_thenable
  from ..error import GraphQLError, GraphQLLocatedError
  from ..pyutils.default_ordered_dict import DefaultOrderedDict
  from ..pyutils.ordereddict import OrderedDict
  from ..type import GraphQLEnumType, GraphQLInterfaceType, GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLScalarType, GraphQLSchema, GraphQLUnionType
  from .base import ExecutionContext, ExecutionResult, ResolveInfo, Undefined, collect_fields, default_resolve_fn, get_field_def, get_operation_root_type
  from .executors.sync import SyncExecutor
  from .experimental.executor import execute
  from .middleware import MiddlewareManager
label_desc: Use image node_id 7 for calling a global function with example usage: complete_value_catching_error(exe_context, return_type, field_asts, info, result) and returns: complete_value, completed, completed, None, None