code: def _add_native_error(default):
      """Append the native error to the message if it exists.
  
      Parameters
      ----------
      default
          list containing all the messages
  
      Returns
      -------
      ret
          list containing all the messages, with the native error appended if it exists
      """
      trace_mode = ivy.exception_trace_mode
      if isinstance(default[-1], Exception):
          if isinstance(default[-1], IvyException):
              if default[-1].native_error is not None:
                  # native error was passed in the message
                  native_error = default[-1].native_error
              else:
                  # a string was passed in the message
                  # hence the last element is an IvyException
                  default[-1] = str(default[-1])
                  return default
          else:
              # exception was raised by the backend natively
              native_error = default[-1]
          if trace_mode == "full":
              default[-1] = native_error.__class__.__name__
              default.append(str(native_error))
          else:
              default[-1] = str(native_error)
      return default
  
imports: import warnings
  import ivy
  import functools
  from typing import Callable
  import traceback
  import inspect
  import os
  import ast
  import builtins
label_desc: Use image node_id 6 for calling a global function with example usage: _add_native_error(default) and returns: default, default