Example #1
0
 public function runDefaultHandler($exception)
 {
     if ($this->needPrettyHandler()) {
         $run = new Run();
         $run->pushHandler(new PrettyPageHandler());
         $run->handleException($exception);
     } else {
         $this->handleError(OuzoExceptionData::forException(500, $exception));
     }
 }
Example #2
0
 public function render(OuzoExceptionData $exceptionData, $viewName)
 {
     /** @noinspection PhpUnusedLocalVariableInspection */
     $errorMessage = $exceptionData->getMessage();
     $errorTrace = $exceptionData->getStackTrace();
     Logger::getLogger(__CLASS__)->error($exceptionData->getOriginalMessage());
     Logger::getLogger(__CLASS__)->error(Objects::toString($errorTrace));
     $this->clearOutputBuffers();
     header($exceptionData->getHeader());
     $responseType = ResponseTypeResolve::resolve();
     header('Content-type: ' . $responseType);
     $additionalHeaders = $exceptionData->getAdditionalHeaders();
     array_walk($additionalHeaders, function ($header) {
         header($header);
     });
     /** @noinspection PhpIncludeInspection */
     require ViewPathResolver::resolveViewPath($viewName, $responseType);
 }
Example #3
0
 protected function runDefaultHandler($exception)
 {
     $this->handleError(OuzoExceptionData::forException(500, $exception));
 }