public function actionDefault(Throwable $exception) { if ($exception instanceof Nette\Application\BadRequestException) { $code = $exception->getCode(); if ($this->logger) { $this->logger->log($exception->getMessage()); } } else { $code = Nette\Http\IResponse::S500_INTERNAL_SERVER_ERROR; if ($this->logger) { $this->logger->log($exception, Tracy\ILogger::EXCEPTION); } } if (ob_get_level() && ob_get_length()) { $this->setLayout(FALSE); } $view = $this->getView(); $this->setView($this->code = $this->translator instanceof Symfony\Component\Translation\TranslatorBagInterface && $this->translator->getCatalogue()->has(implode('.', ['error.message', $code, 'title']), 'web') && $this->translator->getCatalogue()->has(implode('.', ['error.message', $code, 'description']), 'web') ? $code : 0); if (!count($this->formatTemplateFiles())) { $this->setView($view); } }