/**
  * Constructor.
  * @param integer $status HTTP status code, such as 404, 500, etc.
  * @param string $message error message
  * @param \Exception $previous The previous exception used for the exception chaining.
  */
 public function __construct($message = null)
 {
     if (is_array($message)) {
         $message = Json::encode($message);
     }
     parent::__construct(503, $message, null);
 }
 /**
  * Constructor.
  * @param $url, String, the url for the api.
  * @param $response, array, the response from the api
  * @param $params, array, the params sent for the api
  * @param $category, string, the log category
  * @author Rex Chen
  */
 public function __construct(\Exception $previous = null)
 {
     parent::__construct(500, \Yii::t('channel', 'message_send_fail'), $previous);
 }
Esempio n. 3
0
 /**
  * Constructor.
  * @param $url, String, the url for the api.
  * @param $response, array, the response from the api
  * @param $params, array, the params sent for the api
  * @param $category, string, the log category
  * @param $code , int, the error number
  * @author Devin Jin
  */
 public function __construct($url, $response = null, $params = null, $category = 'channel', \Exception $previous = null)
 {
     LogUtil::error(['url' => $url, 'response' => $response, 'params' => $params, 'code' => LogUtil::API_SERVER_ERROR], $category);
     parent::__construct(500, Yii::t('channel', 'api_data_exception'), $previous);
 }