Configures the error handler.
542181
public function configure(Event $event = null)
    {
        if (!$event instanceof KernelEvent ? !$this->firstCall : !$event->isMasterRequest()) {
            return;
        }
        $this->firstCall = $this->hasTerminatedWithException = false;

        $handler = set_exception_handler('var_dump');
        $handler = \is_array($handler) ? $handler[0] : null;
        restore_exception_handler();

        if ($this->logger || null !== $this->throwAt) {
            if ($handler instanceof ErrorHandler) {
                if ($this->logger) {
                    $handler->setDefaultLogger($this->logger, $this->levels);
                    if (\is_array($this->levels)) {
                        $levels = 0;
                        foreach ($this->levels as $type => $log) {
                            $levels |= $type;
                        }
                    } else {
                        $levels = $this->levels;
                    }
                    if ($this->scream) {
                        $handler->screamAt($levels);
                    }
                    if ($this->scope) {
                        $handler->scopeAt($levels & ~E_USER_DEPRECATED & ~E_DEPRECATED);
                    } else {
                        $handler->scopeAt(0, true);
                    }
                    $this->logger = $this->levels = null;
                }
                if (null !== $this->throwAt) {
                    $handler->throwAt($this->throwAt, true);
                }
            }
        }
        if (!$this->exceptionHandler) {
            if ($event instanceof KernelEvent) {
                if (method_exists($kernel = $event->getKernel(), 'terminateWithException')) {
                    $request = $event->getRequest();
                    $hasRun = &$this->hasTerminatedWithException;
                    $this->exceptionHandler = static function (\Exception $e) use ($kernel, $request, &$hasRun) {
                        if ($hasRun) {
                            throw $e;
                        }
                        $hasRun = true;
                        $kernel->terminateWithException($e, $request);
                    };
                }
            } elseif ($event instanceof ConsoleEvent && $app = $event->getCommand()->getApplication()) {
                $output = $event->getOutput();
                if ($output instanceof ConsoleOutputInterface) {
                    $output = $output->getErrorOutput();
                }
                $this->exceptionHandler = function ($e) use ($app, $output) {
                    $app->renderException($e, $output);
                };
            }
        }
        if ($this->exceptionHandler) {
            if ($handler instanceof ErrorHandler) {
                $h = $handler->setExceptionHandler('var_dump');
                if (\is_array($h) && $h[0] instanceof ExceptionHandler) {
                    $handler->setExceptionHandler($h);
                    $handler = $h[0];
                } else {
                    $handler->setExceptionHandler($this->exceptionHandler);
                }
            }
            if ($handler instanceof ExceptionHandler) {
                $handler->setHandler($this->exceptionHandler);
                if (null !== $this->fileLinkFormat) {
                    $handler->setFileLinkFormat($this->fileLinkFormat);
                }
            }
            $this->exceptionHandler = null;
        }
    }
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
758078
@Override
	public void registerErrorHandlers(ErrorHandler... handlers) {
		if (handlers != null) {
			for (ErrorHandler handler : handlers) {
				this.registerErrorHandler(handler);
			}
		}
	}
783331
protected function setErrorReporting()
    {
        /**
         * Configure how verbose PHP is; Everything except E_STRICT and E_ERROR;
         * we'll let the errorHandler pick up fatal errors
         */

        error_reporting(E_ALL ^ E_STRICT ^ E_ERROR);

        //  Configure whether errors are shown or no
        if (function_exists('ini_set')) {
            switch (Environment::get()) {
                case Environment::ENV_PROD:
                    //  Suppress all errors on production
                    ini_set('display_errors', false);
                    break;
                default:
                    //  Show errors everywhere else
                    ini_set('display_errors', true);
                    break;
            }
        }
    }
705539
function (errorHandler) {
        if (!isFunction(errorHandler)) {
            throw new core.TypeError({
                code: 'application-configure',
                message: "errorHandler must be a function"
            });
        }
        this.errorHandlers.push(errorHandler);
        return this;
    }
417612
private void serveError(Status status, String error, RequestHandler requestHandler) throws IOException {
    this.serveError(status, HTTPTrackerErrorMessage.craft(error), requestHandler);
  }
317132
private function _errorConfig() {
        //error code config
        $error1 = (object) [
            'code' => 1,
            'resourceId' => false,
            'description' => 'Resource Not Found'
        ];

        $error2 = (object) [
            'code' => 2,
            'resourceId' => false,
            'description' => 'Circular Dependency Detected'
        ];

        $this->_errorCodes = [
            1 => $error1,
            2 => $error2
        ];
    }
1060627
protected void handleError(Error error) throws Exception {
    String errMsg="error: "+error.getCode()+" info: "+error.getInfo();
    handleError(errMsg);
  }
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;
        }
    }
559922
protected function initErrorHandler()
    {
        if (!isset($this->chainedErrorHandler)) {
            $this->chainedErrorHandler = $this->setErrorHandler([$this, 'handleError']) ?: false;
        }
    }
407051
protected function registerErrorHandler()
    {
        Event::listen('exception.beforeRender', function ($exception, $httpCode, $request) {
            $handler = new ErrorHandler;
            return $handler->handleException($exception);
        });
    }
533937
public function setErrorHandler(callable $errorHandler)
    {
        $this->raiseThrowables();
        $errorHandler = $this->normalizeErrorHandler($errorHandler);
        $this->errorHandler = $errorHandler;
    }
704188
protected function defineErrorHandler()
    {
        $errorRender = $this->obtainErrorRender();
        
        //If not render to use
        if ($errorRender === false) {
            return;
        }

        //add the handler for errors
        set_error_handler([$this, 'errorHandler']);
        
        \BFW\Application::getInstance()
            ->getMonolog()
            ->getLogger()
            ->debug('New error handler defined.')
        ;
    }
1067811
public function handleError()
    {
        if (!$this->shutdownHandlerActive) {
            return;
        }

        $error = error_get_last();

        if ($error['type'] === E_ERROR) {
            $message = sprintf('Error: "%s" in %s on %s', $error['message'], $error['file'], $error['line']);
            $this->task->markError();
            $this->task->addOutput($message);
            $this->logger->error($message);
        }

        // Ensure to release the lock.
        $this->releaseLock();
    }
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
753331
def setErrorHandler(self, errorhandler):
        
        class ErrorHandlerWrapper(ErrorHandler):
            def __init__(self, errorhandler):
                self.errorhandler = errorhandler
                self.last_exception = None

            def error(self, exception):
                if isinstance(exception, amplpython.AMPLException):
                    exception = AMPLException(exception)
                try:
                    self.errorhandler.error(exception)
                except Exception as e:
                    self.last_exception = e

            def warning(self, exception):
                if isinstance(exception, amplpython.AMPLException):
                    exception = AMPLException(exception)
                try:
                    self.errorhandler.warning(exception)
                except Exception as e:
                    self.last_exception = e

            def check(self):
                if self.last_exception is not None:
                    e, self.last_exception = self.last_exception, None
                    raise e

        errorhandler_wrapper = ErrorHandlerWrapper(errorhandler)

        class InnerErrorHandler(amplpython.ErrorHandler):
            def error(self, exception):
                errorhandler_wrapper.error(exception)

            def warning(self, exception):
                errorhandler_wrapper.warning(exception)

        self._errorhandler = errorhandler
        self._errorhandler_inner = InnerErrorHandler()
        self._errorhandler_wrapper = errorhandler_wrapper
        lock_and_call(
            lambda: self._impl.setErrorHandler(self._errorhandler_inner),
            self._lock
        )
27160
def SetErrorHandler(self,f,arg):
        """"""
        if f is None:
            libxml2mod.xmlTextReaderSetErrorHandler(\
                self._o,None,None)
        else:
            libxml2mod.xmlTextReaderSetErrorHandler(\
                self._o,_xmlTextReaderErrorFunc,(f,arg))