From 0c825c695474af2544c8908226df3f3ba33d9f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BA=A6=E5=BD=93=E8=8B=97=E5=84=BF?= Date: Mon, 1 Feb 2016 00:01:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=BC=82=E5=B8=B8=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Exception.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/library/think/Exception.php b/library/think/Exception.php index 58b6e4fb..ff6e4726 100644 --- a/library/think/Exception.php +++ b/library/think/Exception.php @@ -17,6 +17,12 @@ namespace think; */ class Exception extends \Exception { + /** + * 系统异常后发送给客户端的HTTP Status + * @var integer + */ + protected $httpStatus = 500; + /** * 保存异常页面显示的额外Debug数据 * @var array @@ -53,4 +59,13 @@ class Exception extends \Exception { return $this->data; } + + /** + * 获取要发送给客户端的HTTP Status + * @return integer HTTP Status + */ + final public function getHttpStatus() + { + return $this->httpStatus; + } }