예제 #1
0
 /**
  * Error handler for developer mode
  *
  * @param Bootstrap $bootstrap
  * @param \Exception $exception
  * @return bool
  */
 private function handleDeveloperMode(Bootstrap $bootstrap, \Exception $exception)
 {
     if ($bootstrap->isDeveloperMode()) {
         $this->_response->setHttpResponseCode(500);
         $this->_response->setHeader('Content-Type', 'text/plain');
         $this->_response->setBody($exception->getMessage() . "\n" . $exception->getTraceAsString());
         $this->_response->sendResponse();
         return true;
     }
     return false;
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function catchException(Bootstrap $bootstrap, \Exception $exception)
 {
     $this->response->setHttpResponseCode(404);
     $this->response->setHeader('Content-Type', 'text/plain');
     if ($bootstrap->isDeveloperMode()) {
         $this->response->setBody($exception->getMessage() . "\n" . $exception->getTraceAsString());
     }
     $this->response->sendResponse();
     return true;
 }
예제 #3
0
 /**
  * Error handler for developer mode
  *
  * @param Bootstrap $bootstrap
  * @param \Exception $exception
  * @return bool
  */
 private function handleDeveloperMode(Bootstrap $bootstrap, \Exception $exception)
 {
     if ($bootstrap->isDeveloperMode()) {
         if (Bootstrap::ERR_IS_INSTALLED == $bootstrap->getErrorCode()) {
             try {
                 $this->redirectToSetup($bootstrap, $exception);
                 return true;
             } catch (\Exception $e) {
                 $exception = $e;
             }
         }
         $this->_response->setHttpResponseCode(500);
         $this->_response->setHeader('Content-Type', 'text/plain');
         $this->_response->setBody($this->buildContentFromException($exception));
         $this->_response->sendResponse();
         return true;
     }
     return false;
 }
예제 #4
0
 /**
  * {@inheritdoc}
  */
 public function catchException(Bootstrap $bootstrap, \Exception $exception)
 {
     if ($bootstrap->isDeveloperMode()) {
         $this->response->setHttpResponseCode(404);
         $this->response->setHeader('Content-Type', 'text/plain');
         $this->response->setBody($exception->getMessage() . "\n" . $exception->getTraceAsString());
         $this->response->sendResponse();
     } else {
         require $this->getFilesystem()->getDirectoryRead(DirectoryList::PUB)->getAbsolutePath('errors/404.php');
     }
     return true;
 }