基于\think\Exception 才使用 getHttpStatus 方法

This commit is contained in:
Mr.Wang
2016-03-06 17:35:42 +08:00
parent a025bfedac
commit 9dcab5cec2

View File

@@ -141,7 +141,7 @@ class Error
*/
public static function output($exception, array $vars)
{
http_response_code($exception instanceof \Exception ? $exception->getHttpStatus() : 500);
http_response_code($exception instanceof \think\Exception ? $exception->getHttpStatus() : 500);
$type = Config::get('default_return_type');