Calls any installed exception handlers.
197170
def _call_exception_handlers(exception):
  """"""
  for handler in EXCEPTION_HANDLERS:
    try:
      if handler.wants(exception):
        handler.handle(exception)
    except:  # pylint: disable=bare-except
      try:
        # We don't want to stop for exceptions in the exception handlers but
        # we shouldn't hide them either.
        logging.error(traceback.format_exc())
      except:  # pylint: disable=bare-except
        # In case even the logging statement fails, ignore.
        pass
434066
def handle_unhandled_exception(exc_type, exc_value, exc_traceback):
    """"""
    if issubclass(exc_type, KeyboardInterrupt):
        # call the default excepthook saved at __excepthook__
        sys.__excepthook__(exc_type, exc_value, exc_traceback)
        return
    logger = logging.getLogger(__name__) # type: ignore
    logger.critical("Unhandled exception", exc_info=(exc_type, exc_value, exc_traceback))
939677
protected void handleErrors(Collection<Throwable> errors, Object event) {

    if (this.globalExceptionHandler == null) {
      for (Throwable error : errors) {
        LOG.error("Failed to dispatch event {}", event, error);
      }
    } else {
      this.globalExceptionHandler.handleErrors(event, errors.toArray(new Throwable[errors.size()]));
    }
  }
1158987
protected void enableRemoteExceptionHandler() {

        if (GWT.isScript()) {
            // In hosted mode, uncaught exceptions are easier to debug
            return;
        }

        GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {

            /**
             * @see com.google.gwt.core.client.GWT.UncaughtExceptionHandler#onUncaughtException(java.lang.Throwable)
             */
            public void onUncaughtException(Throwable t) {

                if (t instanceof UmbrellaException) {
                    t = ((UmbrellaException)t).getCauses().iterator().next();
                }
                String message = CmsClientStringUtil.getMessage(t);
                CmsNotification.get().send(CmsNotification.Type.WARNING, message);
                CmsLog.log(message + "\n" + CmsClientStringUtil.getStackTrace(t, "\n"));
            }
        });
    }
362090
def wrap_errorhandler(app):
        
        try:
            existing_handler = app.error_handler_spec[None][404][NotFound]
        except (KeyError, TypeError):
            existing_handler = None

        if existing_handler:
            app.error_handler_spec[None][404][NotFound] = \
                lambda error: handle_not_found(error, wrapped=existing_handler)
        else:
            app.error_handler_spec.setdefault(None, {}).setdefault(404, {})
            app.error_handler_spec[None][404][NotFound] = handle_not_found
908678
def register_errors_handler(self, callback, *custom_filters, exception=None, run_task=None, **kwargs):
        
        filters_set = self.filters_factory.resolve(self.errors_handlers,
                                                   *custom_filters,
                                                   exception=exception,
                                                   **kwargs)
        self.errors_handlers.register(self._wrap_async_task(callback, run_task), filters_set)
82382
function setHandlers(enableException, enableUnhandled) {
    if(enableException === true) {
        process.on('uncaughtException', UncaughtExceptionHandler);
    }

    if(enableUnhandled === true) {
        process.on('unhandledRejection', unhandledRejectionHandler);
    }
}
149536
def exception_handler(self, pdb):
        '''
        

        '''

        # Grab the exception
        exctype, value, tb = sys.exc_info()

        # Log the error and create a .err file
        errfile = os.path.join(self.dir, self.name + '.err')
        with open(errfile, 'w') as f:
            for line in traceback.format_exception_only(exctype, value):
                ln = line.replace('\n', '')
                log.error(ln)
                print(ln, file=f)
            for line in traceback.format_tb(tb):
                ln = line.replace('\n', '')
                log.error(ln)
                print(ln, file=f)

        # Re-raise?
        if pdb:
            raise
794975
def _catch_exceptions(self, exctype, value, tb):
        """"""

        # Now we log it.
        self.error('Uncaught exception', exc_info=(exctype, value, tb))

        # First, we print to stdout with some colouring.
        print_exception_formatted(exctype, value, tb)
1130301
def add_exception_handler(self, exception_handler):
        # type: (AbstractExceptionHandler) -> None
        
        if exception_handler is None:
            raise RuntimeConfigException(
                "Valid Exception Handler instance to be provided")

        if not isinstance(exception_handler, AbstractExceptionHandler):
            raise RuntimeConfigException(
                "Input should be an ExceptionHandler instance")

        self.exception_handlers.append(exception_handler)
989912
def error_handler(f):
    """"""
    @wraps(f)
    def inner(*args, **kwargs):
        try:
            return f(*args, **kwargs)
        except NoResultFound:
            abort(404)
        except IntegrityError:
            abort(500)
    return inner
238418
def exception_handler(self, callback):
        
        path = '.'.join([callback.__module__, callback.__name__])
        self._exception_handlers.append(path)
        return callback
1162395
def catch_exceptions(*exceptions):
    """"""
    def wrap(fn):
        @functools.wraps(fn)
        def wrapped_f(*args, **kwargs):
            try:
                return fn(*args, **kwargs)
            except exceptions:
                t, value, traceback = sys.exc_info()
                # If any resource does not exist, return None instead of raising
                if str(value.status) == '404':
                    return None
                e = CloudApiException(str(value), value.reason, value.status)
                raise_(CloudApiException, e, traceback)
        return wrapped_f
    return wrap
1047083
protected function setErrorHandlers()
  {
    # Report all PHP errors (see changelog)
    $this->errorLevel = \error_reporting( E_ALL | E_STRICT);

    # set to the user defined error handler
    $old_error_handler = \set_error_handler(array($this,'errorHandler'), E_ALL);
    $old_exception_handler = \set_exception_handler(array($this,'exceptionHandler'));

    $this->getLogger()->debug('Error handlers set');

    return true;
  }
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)
1305570
def _exception_default_handler(self, e):
        
        if isinstance(e, HTTPError):
            if e.log_message:
                format = "%d %s: " + e.log_message
                args = [e.status_code, self._request_summary()] + list(e.args)
                app_log.warning(format, *args)
            if e.status_code not in httplib.responses:
                app_log.error("Bad HTTP status code: %d", e.status_code)
                self.send_error(500, exc_info=sys.exc_info())
            else:
                self.send_error(e.status_code, exc_info=sys.exc_info())
        else:
            app_log.error("Uncaught exception %s\n%r", self._request_summary(),
                          self.request, exc_info=True)
            self.send_error(500, exc_info=sys.exc_info())
75143
private static void initHandlers() {
		Log.info("Initializing Handlers...");
		for (Handler handler : conf.getHandlers()) {
			try {
				if (!configContext.getHandlers().contains(handler)) {
					Map<String, String> handlerproperties = new HashMap<>();
					handlerproperties.putAll(configContext.getProperties());
					handler.setProperties(handlerproperties);
					handler.init();
					configContext.addHandler(handler);
				}
				Log.info(handler.getClass().getName() + " Initialized.");
			} catch (InitializationException e) {
				Log.error("There is a problem in the hander: ", handler.getClass().getName(),
						ErrorGuide.getGuide(ErrorGuide.HANDLER_ERROR));
				terminate();
				throw new InitializationException(INIT_FAILED, e);
			}
		}
	}