- public function catchException(Bootstrap $bootstrap, \Exception $exception)
- {
- $this->getLogger()->critical($exception->getMessage());
- if ($bootstrap->isDeveloperMode()) {
- $this->response->setHttpResponseCode(404);
- $this->response->setHeader('Content-Type', 'text/plain');
- $this->response->setBody(
- $exception->getMessage() . "\n" .
- Debug::trace(
- $exception->getTrace(),
- true,
- true,
- (bool)getenv('MAGE_DEBUG_SHOW_ARGS')
- )
- );
- $this->response->sendResponse();
- } else {
- require $this->getFilesystem()->getDirectoryRead(DirectoryList::PUB)->getAbsolutePath('errors/404.php');
- }
- return true;
- }