/** * Override of oxException::getValues() * * @return array */ public function getValues() { $aRes = parent::getValues(); $aRes['articleNr'] = $this->getArticleNr(); $aRes['productId'] = $this->getProductId(); return $aRes; }
/** * Get string dump * Overrides oxException::getString() * * @return string */ public function getString() { return __CLASS__ . '-' . parent::getString(); }
/** * Exception constructor. * * @param string $sMessage exception message * @param integer $iCode exception code */ public function __construct($sMessage = "", $iCode = 0) { parent::__construct($sMessage, $iCode); }
/** * Override of oxException::getValues() * * @return array */ public function getValues() { $aRes = parent::getValues(); $aRes['fileName'] = $this->getFileName(); return $aRes; }
/** * 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; }
/** * 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; }
/** * Creates an array of field name => field value of the object. * To make a easy conversion of exceptions to error messages possible. * Should be extended when additional fields are used! * Overrides oxException::getValues(). * * @return array */ public function getValues() { $aRes = parent::getValues(); $aRes['voucherNr'] = $this->getVoucherNr(); return $aRes; }
/** * Creates an array of field name => field value of the object. * To make a easy conversion of exceptions to error messages possible. * Should be extended when additional fields are used! * Overrides oxException::getValues(). * * @return array */ public function getValues() { $aRes = parent::getValues(); $aRes['component'] = $this->getComponent(); return $aRes; }
/** * Override of oxException::getValues() * * @return array */ public function getValues() { $aRes = parent::getValues(); $aRes['adress'] = $this->getAdress(); $aRes['connectionError'] = $this->getConnectionError(); return $aRes; }
/** * 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); } }
/** * Get string dump * Overrides oxException::getString() * * @return string */ public function getString() { return __CLASS__ . '-' . parent::getString() . " Faulty Object --> " . get_class($this->_oObject) . "\n"; }
/** * 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); } }
/** * 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'); } }
/** * Creates an array of field name => field value of the object * to make a easy conversion of exceptions to error messages possible * Overrides oxException::getValues() * should be extended when additional fields are used! * * @return array */ public function getValues() { $aRes = parent::getValues(); $aRes['langConstant'] = $this->getLangConstant(); return $aRes; }