Set the error handling for the application.

@return void
172488
protected function registerErrorHandling()
    {
        mysqli_report(MYSQLI_REPORT_STRICT);
        
        set_error_handler(function ($level, $message, $file = '', $line = 0) {
            if (error_reporting() & $level) {
                throw new ErrorException($message, 0, $level, $file, $line);
            }
        });
        
        set_exception_handler(function ($e) {
            $this->handleUncaughtException($e);
        });
        
        register_shutdown_function(function () {
            if (! is_null($error = error_get_last()) && $this->isFatalError($error['type'])) {
                $this->handleUncaughtException(new FatalErrorException(
                    $error['message'], $error['type'], 0, $error['file'], $error['line']
                ));
            }
        });
    }
653922
public function _handleFailure()
    {
        if($this->isEnabled(self::TYPE_FAILURE))
        {
            $error = error_get_last();

            // Make sure error happened after we started handling them
            if ($error && md5(serialize($error)) !== $this->__last_unhandled_error)
            {
                $level = $error['type'];

                if ($this->getErrorReporting() & $level)
                {
                    $exception = new KExceptionFailure(
                        $error['message'], KHttpResponse::INTERNAL_SERVER_ERROR, $level, $error['file'], $error['line']
                    );

                    $this->handleException($exception);
                }
            }
        }
    }
302702
public function fatalHandler() : void
    {
        $errors = error_get_last();
        if (is_array($errors)) {
            $this->setError(
               (int) $errors['type'],
                (string) $errors['message'],
                (string) $errors['file'],
                (int) $errors['line'],
                'FatalErrorException'
            );

            View::render('500.php', (object) $this->errors);

            return;
        }
    }
1176526
def configure_error_handlers(app):
    

    def render_error(error):
        return (render_template('errors/%s.html' % error.code,
                title=error_messages[error.code], code=error.code), error.code)

    for (errcode, title) in error_messages.iteritems():
        app.errorhandler(errcode)(render_error)
142267
public function handleShutdown()
    {
        if (! is_null($error = error_get_last()) && $this->isFatal($error['type'])) {
            $exception = new ErrorException($error['message'], $error['type'], 0, $error['file'], $error['line']);
            $this->handleException($exception);
        }
    }
407863
public function errorAction()
    {
        $errors       = $this->_getParam('error_handler');
        $exception    = $errors->exception;
        $info         = null;
        $message      = 'Application error';
        $responseCode = 200;

        switch ($errors->type) {
            case \Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
            case \Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
                // 404 error -- controller or action not found
                $responseCode = 404;
                $message      = 'Page not found';
                break;

            case \Zend_Controller_Plugin_ErrorHandler::EXCEPTION_OTHER:

                if ($exception instanceof \Gems_Exception) {
                    $responseCode = $exception->getCode();
                    $message      = $exception->getMessage();
                    $info         = $exception->getInfo();
                    break;
                }
                // Intentional fall through

            default:
                $message = $exception->getMessage();
                break;
        }

        \Gems_Log::getLogger()->logError($errors->exception, $errors->request);

        if (\MUtil_Console::isConsole()) {
            $this->_helper->viewRenderer->setNoRender(true);

            echo $message . "\n\n";
            if ($info) {
                echo $info . "\n\n";
            }

            $next = $exception->getPrevious();
            while ($next) {
                echo '  ' . $next->getMessage() . "\n";
                $next = $next->getPrevious();
            }

            echo $exception->getTraceAsString();

        } else {
            if ($responseCode) {
                $this->getResponse()->setHttpResponseCode($responseCode);
            }

            $this->view->exception = $exception;
            $this->view->message   = $message;
            $this->view->request   = $errors->request;
            if ($info) {
                $this->view->info = $info;
            }

        }
    }
26801
public function handleShutdown()
    {
        $error = $this->system->getLastError();
        if ($error === null) {
            return;
        }
        if (($error['type'] & error_reporting()) === 0) {
            return;
        }
        if ($this->lastError !== null &&
            $error['message'] === $this->lastError['message'] &&
            $error['file'] === $this->lastError['file'] &&
            $error['line'] === $this->lastError['line']) {
            return;
        }
        $trace = [[
            'file' => $error['file'],
            'line' => $error['line'],
        ]];
        $exc = new Fatal($error['message'], $trace);
        $notice = $this->buildNotice($exc);

        // If we reached this step, we are in shutdown handler.
        // An exception thrown in a shutdown handler will not be propagated
        // to the exception handler. Pass that information along.
        $this->canThrowExceptions = false;

        if ($error && $this->isLevelFatal($error['type'])) {
            // If there was a fatal error,
            // it was not handled in handleError yet.
            $this->handleError(
                $error['type'],
                $error['message'],
                $error['file'],
                $error['line']
            );
        }
		if($error["type"] != 0) {
            //call_user_func($this->errorHandler,new ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line']));
			//log_error( $error["type"], $error["message"], $error["file"], $error["line"] );
		}
    }
1293249
public function run()
    {
        set_error_handler(array('\Slim\App', 'handleErrors'));

        // Invoke middleware and application stack
        try {
            $this['middleware'][0]->call();
        } catch (\Exception $e) {
            $this['response']->write($this->callErrorHandler($e), true);
        }

        // Finalize and send response
        $this->finalize();

        restore_error_handler();
    }
964013
public static function set(): ?callable
    {
        if (! static::$handler) {
            static::$handler = function ($severity, $message, $file, $line): void {
                throw new \ErrorException($message, 0, $severity, $file, $line);
            };
        }

        return set_error_handler(static::$handler, E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED);
    }
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;
    }
837421
private function handleStartupErrors(): void
    {
        $selected = $this->selectErrorStream();
        if (false === $selected) {
            throw new \UnexpectedValueException('Something went wrong while selecting a stream.');
        }

        $errors = $this->readProcessErrors();

        if (is_resource($this->process) === false || empty($errors) === false) {
            throw new \UnexpectedValueException(
                sprintf('The process "%s" could not be opened: ' . $errors, $this->command)
            );
        }
    }
1130080
protected function cleanup_error_handler()
    {
        restore_error_handler();

        if ($this->last_error !== null) {
            throw new \ErrorException(
                $this->last_error['errstr'],
                0,
                $this->last_error['errno'],
                $this->last_error['errfile'],
                $this->last_error['errline']
            );
        }
    }
172272
public function actionError()
	{
		if($error=Yii::app()->errorHandler->error)
		{
			if(Yii::app()->request->isAjaxRequest)
				echo $error['message'];
			else
				$this->render('error', $error);
		}
	}
806764
public function handle() {
		if (\Skeleton\Core\Hook::exists('handle_error', [$this->exception])) {
			// If the error is handled within the application, no need to continue
			// internally.
			$this->last_handler = true;
			\Skeleton\Core\Hook::call('handle_error', [$this->exception]);
		}
	}
1291472
private function registerErrorHandler(): void
    {
        $whoops = new Run();
        $whoops->pushHandler(new PrettyPageHandler());
        $whoops->register();

        $this->errorHandler = $whoops;
    }
646053
protected function _startErrorHandler()
    {
        $this->_whoops = new Run();
        $environment = $this->getConfiguration()
            ->get('environment', 'production');

        switch ($environment) {
            case 'production':
                $handler = new Production();
                $handler->setApplication($this);
                break;

            default:
                $handler = new PrettyPageHandler();
        }

        $this->_whoops->pushHandler($handler);

        $this->_whoops->register();
        return $this;
    }
107426
public function callError() {
        if (!($this->error instanceof Error)) {
            $this->error = new Error();
        }

        $status = $this->error->getStatus();
        $this->app->response->status($status);

        if (is_callable($this->options["error"])) {
            $this->options["error"]($this->error);
        }
    }