Enable fatal/non-recoverable error handling.
344058
public function enableFatalErrorHandling() {
        if ($this->isFatalErrorHandlingEnabled()) {
            return;
        }

        register_shutdown_function(function () {
            return $this->errorConverter
                ->extractFatalErrorAndCallHandler($this);
        });
        $this->isFatalErrorHandlingEnabled = true;
    }
662196
def handle_error(self, msgtype, msgid, error):
        """"""
        self._proxy.error(msgid, error)
396705
def fatal(self, msg, exc=None):
        
        if exc is not None:
            self.LOG.fatal("%s (%s)" % (msg, exc))
            if self.options.debug:
                return # let the caller re-raise it
        else:
            self.LOG.fatal(msg)
        sys.exit(error.EX_SOFTWARE)
871002
protected function handleShutdown()
    {
        if (! \is_null($error = \error_get_last()) && $this->isFatalError($error['type'])) {
            $this->handleUncaughtException(new FatalErrorException(
                $error['message'], $error['type'], 0, $error['file'], $error['line']
            ));
        }
    }
1296194
def setErrorHandler(self,f,arg):
        """"""
        libxml2mod.xmlParserCtxtSetErrorHandler(self._o,f,arg)
1310309
protected function register(): void
	{
		// Allows us to handle "fatal" errors

		register_shutdown_function(function(): void
		{
			$e = error_get_last();

			if($e !== null && (error_reporting() & $e['type']) !== 0 && !$this->disableShutdownHandler)
			{
				$this->handler(new ErrorException($e['message'], $e['type'], 0, $e['file'], $e['line']));

				exit(1);
			}
		});

		// Set the exception handler

		set_exception_handler([$this, 'handler']);
	}
1142579
def handle_error(index_name, keep=False):
    '''
    
    '''
    # Handle keyboard interrupt
    signal.signal(signal.SIGINT, signal.default_int_handler)
    signal.signal(signal.SIGTERM, signal.default_int_handler)
    has_error = False
    try:
        yield
    except KeyboardInterrupt:
        print('')  # Proper warning message under the "^C" display
        log.warning('Interrupted by signal')
        has_error = True
    except Exception as e:
        log.error(e)
        has_error = True
    if has_error:
        if not keep:
            log.info('Removing index %s', index_name)
            es.indices.delete(index=index_name)
        sys.exit(-1)
1240266
public function handleShutdown()
	{
		$error = error_get_last();

		// If an error has occurred that has not been displayed, we will create a fatal
		// error exception instance and pass it into the regular exception handling
		// code so it can be displayed back out to the developer for information.
		if ( ! is_null($error))
		{
			extract($error);

			if ( ! $this->isFatal($type)) return;

			$this->handleException(new FatalError($message, $type, 0, $file, $line))->send();
		}
	}
362574
function _trigger_fatal_error($error_msg, $tpl_file = null, $tpl_line = null,
	$file = null, $line = null, $error_type = E_USER_ERROR)
	{
		if(isset($file) && isset($line)) {
			$info = ' ('.basename($file).", line $line)";
		} else {
			$info = '';
		}
		if (isset($tpl_line) && isset($tpl_file)) {
			$this->trigger_error('[in ' . $tpl_file . ' line ' . $tpl_line . "]: $error_msg$info", $error_type);
		} else {
			$this->trigger_error($error_msg . $info, $error_type);
		}
	}
724822
def handle_error(response):
    """"""
    status_code = response.status_code

    if status_code not in A_OK_HTTP_CODES:
        error_explanation = A_ERROR_HTTP_CODES.get(status_code)
        raise_error = "{}: {}".format(status_code, error_explanation)
        raise Exception(raise_error)
    else:
        return True
691510
public function handleShutdown()
	{
		if ( !is_null( $error = error_get_last() ) && in_array( $error['type'], [
				E_ERROR,
				E_CORE_ERROR,
				E_COMPILE_ERROR,
				E_PARSE
			] )
		)
		{
			$this->handleException( new FatalErrorException( $error['message'], $error['type'], 0, $error['file'], $error['line'], 0 ) );
		}
	}
1102148
def _handle_errors(errors):
  """"""
  if not errors:
    return
  log_all = True  # pylint: disable=unused-variable
  err_msg = "T2T: skipped importing {num_missing} data_generators modules."
  print(err_msg.format(num_missing=len(errors)))
  for module, err in errors:
    err_str = str(err)
    if not _is_import_err_msg(err_str, module):
      print("From module %s" % module)
      raise err
    if log_all:
      print("Did not import module: %s; Cause: %s" % (module, err_str))
843253
def temp_fail_retry(error, fun, *args):
    """"""
    while 1:
        try:
            return fun(*args)
        except error as e:
            eintr = errno.WSAEINTR if os.name == 'nt' else errno.EINTR
            if e.args[0] == eintr:
                continue
            raise
809558
def handle_error(self, env):
        '''
        '''
        logger.exception('Exception for %s %s :',
                         env.request.method, env.request.url)
1283355
def fatal(*args, **kwargs):
    
    # determine the exitcode to return to the operating system
    exitcode = None
    if 'exitcode' in kwargs:
        exitcode = kwargs.pop('exitcode')
    if 'cause' in kwargs:
        cause = kwargs.pop('cause')
        if not isinstance(cause, Result):
            raise TypeError(
                "invalid cause of fatal error: expected %r, got %r" % (
                    Result, type(cause)))
        exitcode = exitcode or cause.return_code

    logging.error(*args, **kwargs)
    raise Exit(exitcode or -1)
883462
protected function setupExceptionHandling($value) {
        $enabled = true;                                            // default
        if (is_bool($value) || is_int($value)) {
            $enabled = (bool) $value;
        }
        elseif (is_string($value)) {
            $value   = trim(strtolower($value));
            $enabled = ($value=='0' || $value=='off' || $value=='false');
        }
        $enabled && ErrorHandler::setupExceptionHandling();
    }
607480
def error_handler(f):
    """"""
    @wraps(f)
    def inner(*args, **kwargs):
        try:
            return f(*args, **kwargs)
        except ReceiverDoesNotExist:
            return jsonify(
                status=404,
                description='Receiver does not exists.'
            ), 404
        except InvalidPayload as e:
            return jsonify(
                status=415,
                description='Receiver does not support the'
                            ' content-type "%s".' % e.args[0]
            ), 415
        except WebhooksError:
            return jsonify(
                status=500,
                description='Internal server error'
            ), 500
    return inner