Common exception handling behavior across all exceptions.

        .. note:: This for internal use and should not be extended or used
            directly.
11035
def _handle_exception(self, exc):
        
        exc_info = sys.exc_info()
        self.logger.exception(
            '%s while processing message #%s',
            exc.__class__.__name__, self._message.delivery_tag,
            exc_info=exc_info)
        self._measurement.set_tag('exception', exc.__class__.__name__)
        if hasattr(exc, 'metric') and exc.metric:
            self._measurement.set_tag('error', exc.metric)
        self._process.send_exception_to_sentry(exc_info)
        self._maybe_clear_confirmation_futures()
        if not self._finished:
            self.on_finish(exc)
        self._finished = True
351025
private void handleException(String key, Exception e) {
        if (e != null) {
            log.error(key, e.getLocalizedMessage());
            throw new Abort(e);
        } else {
            log.error(key);
            throw new Abort();
        }
    }
374321
public void setException(Throwable exception) {
    this.exception = exception;

    if (handlers != null) {
      for (IsSimplePromiseResponseHandler<T> h : handlers) {
        h.onResponse(this);
      }
    }
  }
791045
def handle_exception(self, *args):
        

        if not self.__enabled:
            return

        cls, instance, trcback = foundations.exceptions.extract_exception(*args)

        LOGGER.info("{0} | Handling '{1}' exception!".format(
            self.__class__.__name__, foundations.strings.to_string(cls)))

        self.__initialize_context_ui()

        self.__update_html(self.format_html_exception(cls, instance, trcback))

        self.show()
        self.__report and self.report_exception_to_crittercism(cls, instance, trcback)
        foundations.exceptions.base_exception_handler(cls, instance, trcback)
        self.exec_()
791589
def handle_exception(e)
    raise e unless defined?(e.response) && e.response != nil

    code = e.response[:status]
    error = Nokogiri::XML(e.response[:body])

    message = if error.xpath("m:error/m:message", @ds_namespaces).first
                error.xpath("m:error/m:message", @ds_namespaces).first.content
              else
                "Server returned error but no message."
              end
    raise ServiceError.new(code), message
  end
477156
def exception(self, e):
        
        self.logged_exception(e)
        self.logger.exception(e)
249504
def process_exception(self, request, e):
        
        if isinstance(e, RedirectException):
            response = e.get_response()
            self.process_response(request, response)
1037795
def exception_set(self, exception=None):
        
        if not exception:
            exception = sys.exc_info()
        self.exception = exception
        self.exception_raise = self._exception_raise
1355471
def example_exc_handler(tries_remaining, exception, delay):
    
    print >> sys.stderr, "Caught '%s', %d tries remaining, sleeping for %s seconds" % (
        exception, tries_remaining, delay)
902764
def exception(self, *exceptions):
        

        def response(handler):
            for exception in exceptions:
                if isinstance(exception, (tuple, list)):
                    for e in exception:
                        self.error_handler.add(e, handler)
                else:
                    self.error_handler.add(exception, handler)
            return handler

        return response
1070357
public static function initialiseErrorHandler()
    {
        // Initialise logging
        self::initialiseLog();
        GenericExceptionHandler::initialise(self::Log());
        GenericErrorHandler::initialise(self::Log());
    }
1136482
def throws(exc):
    '''
    
    '''
    if not __CHECKING__:
        return lambda f: f

    def wrap(f):
        def call(*args, **kwd):
            res = f(*args, **kwd)
            # raise UncheckedExceptionError if exc is not automatically
            # registered by a function decorated with @catches(exc);
            # otherwise do nothing
            exc_checker.throwing(exc)
            return res
        call.__name__ = f.__name__
        return call
    return wrap
915117
def standard_exception_handling
      yield
    rescue SystemExit
      # Exit silently with current status
      raise
    rescue OptionParser::InvalidOption => ex
      $stderr.puts ex.message
      exit(false)
    rescue Exception => ex
      # Exit with error message
      display_error_message(ex)
      exit_because_of_exception(ex)
    end
1278310
async def handle_exception(self, error: Exception) -> Response:
        
        await got_request_exception.send(self, exception=error)

        self.log_exception(sys.exc_info())

        if self.propagate_exceptions:
            return await traceback_response()

        internal_server_error = all_http_exceptions[500]()
        handler = self._find_exception_handler(internal_server_error)

        if handler is None:
            return internal_server_error.get_response()
        else:
            return await self.finalize_request(await handler(error), from_error_handler=True)
171177
private void defineUncaughtExceptionHandler() {
        MethodInfo mi = mClassFile.addMethod
            (Modifiers.PRIVATE.toStatic(true), UNCAUGHT_METHOD_NAME, null,
             new TypeDesc[] {TypeDesc.forClass(Throwable.class)});
        CodeBuilder b = new CodeBuilder(mi);

        // Thread t = Thread.currentThread();
        // t.getUncaughtExceptionHandler().uncaughtException(t, e);
        TypeDesc threadType = TypeDesc.forClass(Thread.class);
        b.invokeStatic(Thread.class.getName(), "currentThread", threadType, null);
        LocalVariable threadVar = b.createLocalVariable(null, threadType);
        b.storeLocal(threadVar);
        b.loadLocal(threadVar);
        TypeDesc handlerType = TypeDesc.forClass(Thread.UncaughtExceptionHandler.class);
        b.invokeVirtual(threadType, "getUncaughtExceptionHandler", handlerType, null);
        b.loadLocal(threadVar);
        b.loadLocal(b.getParameter(0));
        b.invokeInterface(handlerType, "uncaughtException", null,
                          new TypeDesc[] {threadType, TypeDesc.forClass(Throwable.class)});
        b.returnVoid();
    }
571884
protected void propagateException(ActivityExecution execution, Exception ex) throws Exception {
    BpmnError bpmnError = checkIfCauseOfExceptionIsBpmnError(ex);
    if (bpmnError != null) {
      propagateBpmnError(bpmnError, execution);
    } else {
      propagateExceptionAsError(ex, execution);
    }
  }
500528
@Override
    public void onError(final Throwable t) {

        Objects.requireNonNull(t);

        if (errorHandler != null)
            errorHandler.accept(t);

    }