/** * @brief 构建一个异常,errors代表携带的错误信息 * * @retval * @see * @note * @author 吕宝贵 * @date 2016/03/20 16:25:18 **/ public function __construct($message, $code = 1, $errors = null, $previous = null) { if (!empty($errors)) { $this->_errors = $errors; } parent::__construct($message, $code, $previous); }
public function __construct($code = null) { if (!$code || !isset(static::$messages[$code])) { $code = $this->defaultCode; } parent::__construct(static::$messages[$code], $code); }
public function __construct($message = null, $code = 0, \Exception $previous = null, $post = []) { $this->post = serialize($post); parent::__construct($message, $code, $previous); }
/** * Constructor. * @param string $error_description (optional) * @param string $error A single error code * @param string $name error name */ public function __construct($error_description = null, $error = self::INVALID_REQUEST) { $this->error = $error; parent::__construct($error_description, 0, null); }
/** * Constructor. * @param integer $status HTTP status code, such as 404, 500, etc. * @param string $message error message * @param integer $code error code * @param \Exception $previous The previous exception used for the exception chaining. */ public function __construct($status, $message = null, $code = 0, \Exception $previous = null) { $this->statusCode = $status; parent::__construct($message, $code, $previous); }
/** * Returns the array representation of this object. * @return array the array representation of this object. */ public function toArray() { $array = parent::toArray(); $array['status'] = $this->statusCode; return $array; }
public function __construct($resp = null, $code = 0, \Exception $previous = null) { parent::__construct(json_encode($resp), $code, $previous); }
public function __construct($message = "", $code = 0, $data = [], Exception $previous = null) { parent::__construct($message, $code, $previous); $this->data = $data; }