Use the global error handler
559922
protected function initErrorHandler()
    {
        if (!isset($this->chainedErrorHandler)) {
            $this->chainedErrorHandler = $this->setErrorHandler([$this, 'handleError']) ?: false;
        }
    }
525242
def handle_error(e, name, args, job)
      if error_handler = Backburner.configuration.on_error
        if error_handler.arity == 1
          error_handler.call(e)
        elsif error_handler.arity == 3
          error_handler.call(e, name, args)
        else
          error_handler.call(e, name, args, job)
        end
      end
    end
612937
function popErrorHandling()
    {
        $stack = &$GLOBALS['_PEAR_error_handler_stack'];
        array_pop($stack);
        list($mode, $options) = $stack[sizeof($stack) - 1];
        array_pop($stack);
        if (isset($this) && is_a($this, 'PEAR')) {
            $this->setErrorHandling($mode, $options);
        } else {
            PEAR::setErrorHandling($mode, $options);
        }
        return true;
    }
241033
function UncaughtExceptionHandler(error) {
    // Call module.exports.crit here so that we can intercept the call in the tests
    module.exports.crit(`Unhandled exception: ${error.message}`);
    module.exports.crit(error.stack.toString());
    process.exit(1);
}
1236209
def handle_g_error(error, return_value):
    
    error = error[0]
    assert bool(return_value) == (error == ffi.NULL)
    if error != ffi.NULL:
        if error.message != ffi.NULL:
            message = ('Pixbuf error: ' +
                       ffi.string(error.message).decode('utf8', 'replace'))
        else:  # pragma: no cover
            message = 'Pixbuf error'
        glib.g_error_free(error)
        raise ImageLoadingError(message)
312949
function tryWrapper(handler, ...args) {
    try {
        handler(...args);
    } catch (err) {
        console.error(`handler received an error: ${err.message}, ${JSON.stringify(err)}`);
    }
}
1121101
def error_handler(task):
    """"""
    @wraps(task)
    def wrapper(self, *args, **kwargs):
        try:
            return task(self, *args, **kwargs)
        except Exception as e:
            self.connected = False
            if not self.testing:
                exc_type, exc_obj, exc_tb = sys.exc_info()
                fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
                error_message = (
                    "[" + str(datetime.now()) + "] Error in task \"" +
                    task.__name__ + "\" (" +
                    fname + "/" + str(exc_tb.tb_lineno) +
                    ")" + e.message
                )
                self.logger.error("%s: RPC instruction failed" % error_message)
    return wrapper
613549
function (isGlobal, server, err, msg, session, resp, opts, cb) {
  let fm;
  if (isGlobal) {
    fm = server.globalFilterService;
  } else {
    fm = server.filterService;
  }
  if (fm) {
    if (isGlobal) {
      fm.afterFilter(err, msg, session, resp, function () {
        // do nothing
      });
    } else {
      fm.afterFilter(err, msg, session, resp, function (err) {
        cb(err, resp, opts);
      });
    }
  }
}
1223560
def errors_handler(self, *custom_filters, exception=None, run_task=None, **kwargs):
        

        def decorator(callback):
            self.register_errors_handler(self._wrap_async_task(callback, run_task),
                                         *custom_filters, exception=exception, **kwargs)
            return callback

        return decorator
859202
function _onError(error) {
        if (_connectDeferred) {
            _connectDeferred.reject();
            _connectDeferred = null;
        }
        exports.trigger("error", error);
    }
966048
def handle_error(self, exc, msg):
        
        if self.mode == "api":
            logger.error(msg)
            if self.strict:
                raise exc
        elif self.mode == "cli":
            sys.stderr.write(msg)
            sys.exit(1)
856977
function handleError(reject) {
  return (e) => {
    // prevent global error throw https://bugzilla.mozilla.org/show_bug.cgi?id=872873
    if (typeof e.preventDefault === 'function') e.preventDefault()
    reject(e.target.error)
  }
}
945377
function handleError(error) {
	console.log(`${options.entry} failed.`);
	console.trace(error);

	setTimeout(() => {
		throw error;
	});
}
1033660
static function errorHandler($errno, $errstr, $errfile, $errline) {
	    switch ($errno) {
	    case E_USER_ERROR:
	        echo "<b>ERROR:</b> [$errno] $errstr<br>
	        <b>File: </b>$errfile [$errline]<br>
	        Aborting...<br>";
	        exit(1);
	        break;

	    case E_USER_WARNING:
	        echo "<b>WARNING:</b> [$errno] $errstr<br><b>File:</b> $errfile [$errline]";
	        break;

	    case E_USER_NOTICE:
	        echo "<b>NOTICE:</b> [$errno] $errstr<br><b>File:</b> $errfile [$errline]";
	        break;

	    default:
	        echo "<b>Unknown error type:</b> [$errno] $errstr<br><b>File:</b> $errfile [$errline]";
	        break;
	    }

	    /* Don't execute PHP internal error handler */
	    return true;
	}
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
545806
function createErrorHandler(yargs) {
	if (!yargs) {
		yargs = Yargs;
	}
	return consoleErrorLogger.bind(undefined, console, yargs, true);
}
262247
function onClientError(err) {
    // Ignore ECONNRESET errors
    if ((err || {}).errno !== 'ECONNRESET') {
      log.error('An unhandled error occured when searching for the root DSE at "%s". Error: %j', url, err);
      if (hasEvents.call(self, 'error')) self.emit('error', err)
    }
  }