/**
  * Deal with uncaught oxException exceptions.
  * IMPORTANT: uses _safeShopRedirectAndExit(), see description
  *
  * @param oxException $oEx Exception to handle
  *
  * @return null
  */
 protected function _uncaughtException(oxException $oEx)
 {
     // exception occured in function processing
     $oEx->setNotCaught();
     // general log entry for all exceptions here
     $oEx->debugOut();
     if (defined('OXID_PHP_UNIT')) {
         return $oEx->getString();
     } elseif (0 != $this->_iDebug) {
         oxUtils::getInstance()->showMessageAndExit($oEx->getString());
     }
     //simple safe redirect in productive mode
     $sShopUrl = oxConfig::getInstance()->getShopMainUrl();
     $this->_safeShopRedirectAndExit($sShopUrl . "offline.html");
     //should not be reached
     return;
 }
Ejemplo n.º 2
0
 /**
  * Deal with uncaught oxException exceptions.
  *
  * @param oxException $oEx Exception to handle
  *
  * @return null
  */
 protected function _uncaughtException($oEx)
 {
     // exception occurred in function processing
     $oEx->setNotCaught();
     // general log entry for all exceptions here
     $oEx->debugOut();
     if (defined('OXID_PHP_UNIT')) {
         return $oEx->getString();
     } elseif (0 != $this->_iDebug) {
         oxRegistry::getUtils()->showMessageAndExit($oEx->getString());
     }
     try {
         oxRegistry::getUtils()->redirectOffline(500);
     } catch (Exception $oException) {
     }
     exit;
 }
Ejemplo n.º 3
0
 /**
  * Shows exception message if debug mode is enabled, redirects otherwise.
  *
  * @param oxException $oEx message to show on exit
  *
  * @return bool
  */
 protected function _handleDbConnectionException($oEx)
 {
     $oEx->debugOut();
     if (0 != $this->getConfigParam('iDebug')) {
         oxRegistry::getUtils()->showMessageAndExit($oEx->getString());
     } else {
         header("HTTP/1.1 500 Internal Server Error");
         header("Location: offline.html");
         header("Connection: close");
         exit(1);
     }
 }
Ejemplo n.º 4
0
 /**
  * Shows exception message if debug mode is enabled, redirects otherwise.
  *
  * @param oxException $oEx message to show on exit
  *
  * @return bool
  */
 protected function _handleDbConnectionException($oEx)
 {
     $oEx->debugOut();
     if (defined('OXID_PHP_UNIT')) {
         return false;
     } elseif (0 != $this->iDebug) {
         oxRegistry::getUtils()->showMessageAndExit($oEx->getString());
     } else {
         header("HTTP/1.1 500 Internal Server Error");
         header("Location: offline.html");
         header("Connection: close");
         exit(1);
     }
 }
Ejemplo n.º 5
0
 /**
  * Catching other not caught exceptions.
  *
  * @param oxException $oEx
  */
 protected function _handleBaseException($oEx)
 {
     $oEx->debugOut();
     if ($this->_isDebugMode()) {
         oxRegistry::get("oxUtilsView")->addErrorToDisplay($oEx);
         $this->_process('exceptionError', 'displayExceptionError');
     }
 }