<?php namespace app\admin; use think\exception\HttpException; /** * 抛出json异常错误 */ class ErrorException extends HttpException { public function __construct($message = null, $code = 1000, $status = 200, \Exception $previous = null) { $this->message = $message; parent::__construct($status, $message, $previous, $headers = [], $code); } }