code: def wrap(self, cause):
          
          if isinstance(cause, ApplicationException):
              return cause
              
          self.with_cause(cause)
          return self
docs: Wraps another exception into an application exception object.
  
          If original exception is of ApplicationException type it is returned without changes.
          Otherwise a new ApplicationException is created and original error is set as its cause.
  
          :param cause: an original error object
  
          :return: an original or newly created ApplicationException