From 8b328b77e0a8eea06f504497e789fd86a0070de9 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 22 Aug 2016 18:15:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E9=AA=8C=E8=AF=81=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E7=B1=BB=E7=9A=84=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=92=8C=E6=A8=A1=E6=9D=BF=E8=BE=93=E5=87=BA=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=89=B9=E9=87=8F=E9=AA=8C=E8=AF=81=E7=9A=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BF=A1=E6=81=AF=E6=8A=9B=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/exception/ValidateException.php | 21 ++++++++++--------- tpl/think_exception.tpl | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/library/think/exception/ValidateException.php b/library/think/exception/ValidateException.php index 6f1cd4d1..03599f5b 100644 --- a/library/think/exception/ValidateException.php +++ b/library/think/exception/ValidateException.php @@ -13,20 +13,21 @@ namespace think\exception; class ValidateException extends \RuntimeException { - protected $error; + protected $error; - public function __construct($error) - { - $this->error = $error; - } + public function __construct($error) + { + $this->error = $error; + $this->message = is_array($error) ? implode("\n\r", $error) : $error; + } /** * 获取验证错误信息 * @access public * @return array|string */ - public function getError() - { - return $this->error; - } -} \ No newline at end of file + public function getError() + { + return $this->error; + } +} diff --git a/tpl/think_exception.tpl b/tpl/think_exception.tpl index 37b53999..bc246897 100644 --- a/tpl/think_exception.tpl +++ b/tpl/think_exception.tpl @@ -292,7 +292,7 @@

[]

-

+