Phprest\Application::setErrorHandler PHP 메소드

setErrorHandler() 보호된 메소드

protected setErrorHandler ( ) : void
리턴 void
    protected function setErrorHandler()
    {
        $app = $this;
        $this->configuration->getLogHandler()->setLogger($this->serviceLogger());
        $this->configuration->getErrorHandler()->pushHandler($this->configuration->getLogHandler());
        $this->configuration->getErrorHandler()->register();
        $this->setExceptionDecorator(function (\Exception $e) use($app) {
            $formatter = new ErrorHandler\Formatter\JsonXml($app->configuration);
            return new Response($formatter->format($e), http_response_code());
        });
    }