public function __construct($message = "", $code = 0, Exception $previous = null, Mage_Core_Block_Abstract $block = null) { parent::__construct($message, $code, $previous); if ($block !== null) { $this->block = $block; } }
/** * Our error codes are strings, however the core Exception class only accepts integers, so we need to overload it. * * @param string $message * @param mixed $code * @param Exception|null $previous * * @see Exception::__construct() * * @link http://www.php.net/manual/en/exception.construct.php */ public function __construct($message, $code = 0, Exception $previous = null) { parent::__construct($message, 0, $previous); /** * Replace the code with the actual, non-integer code. */ if ($code !== 0) { $code = (string) $code; $this->code = $code; } }
/** * Make a new API Exception with the given result. * * @param array $result The result from the API server */ public function __construct($result) { $this->result = $result; $code = isset($result['error_code']) ? $result['error_code'] : 0; if (isset($result['error_description'])) { // OAuth 2.0 Draft 10 style $msg = $result['error_description']; } else { if (isset($result['error']) && is_array($result['error'])) { // OAuth 2.0 Draft 00 style $msg = $result['error']['message']; } else { if (isset($result['error_msg'])) { // Rest server style $msg = $result['error_msg']; } else { $msg = 'Unknown Error. Check getResult()'; } } } parent::__construct($msg, $code); }
public function __construct($faultCode, $customMessage = null) { parent::__construct($faultCode); $this->_customMessage = $customMessage; }
public function __construct($message, $details = '', $level = 1, $module = '') { Mage::helper('awcore/logger')->log($this, $message, AW_Core_Model_Logger::LOG_SEVERITY_WARNING, $details, $this->getLine()); return parent::__construct($message); }
/** * Clear out user and session data when validation fails. Dispatch an event, * set session messages and unset user data before returning the empty * user object. * @param Mage_Admin_Model_User $user * @param Mage_Core_Controller_Request_Http $request * @param Mage_Core_Exception $authException * @return null * @codeCoverageIgnore All side-effects taken from Magento auth/login process */ protected function _failValidation(Mage_Admin_Model_User $user, Mage_Core_Controller_Request_Http $request = null, Mage_Core_Exception $authException) { $logMessage = 'Failed to authenticate using token.'; $this->logger->info($logMessage, $this->context->getMetaData(__CLASS__)); // This may be problematic due to the missing user password. It is never // given while doing the token auth so we don't have one to pass. So far // it doesn't seem to be causing any issues but may have some impact on the // Mage_Enterprise_Pci_Model_Observer::adminAuthenticate method. Mage::dispatchEvent('admin_user_authenticate_after', array('username' => $user->getUsername(), 'password' => '', 'user' => $user, 'result' => false)); Mage::dispatchEvent('admin_session_user_login_failed', array('user_name' => $user->getUsername(), 'exception' => $authException)); if ($request && !$request->getParam('messageSent')) { Mage::getSingleton('adminhtml/session')->addError($authException->getMessage()); $request->setParam('messageSent', true); } $user->unsetData(); $this->_postAuthCheckRedirect(Mage::helper('adminhtml')->getUrl('*')); }
public function __construct($resultCode, array $messages = array(), $code = 0) { parent::__construct('AvaTax failure response: ' . $resultCode, $code); $this->messages = $messages; }