Beispiel #1
0
 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;
     }
 }
Beispiel #2
0
 /**
  * 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);
 }
Beispiel #4
0
 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);
 }
Beispiel #6
0
 public function __construct($resultCode, array $messages = array(), $code = 0)
 {
     parent::__construct('AvaTax failure response: ' . $resultCode, $code);
     $this->messages = $messages;
 }