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 @@