mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-10 00:22:48 +08:00
修正错误
This commit is contained in:
@@ -13,7 +13,6 @@ namespace think;
|
||||
|
||||
use think\Exception;
|
||||
use think\exception\ErrorException;
|
||||
use think\exception\NotFoundException;
|
||||
|
||||
class Error
|
||||
{
|
||||
@@ -69,13 +68,13 @@ class Error
|
||||
'Server/Request Data' => $_SERVER,
|
||||
'Environment Variables' => $_ENV,
|
||||
'ThinkPHP Constants' => self::getTPConst(),
|
||||
]
|
||||
],
|
||||
];
|
||||
} else {
|
||||
/* 部署模式仅显示 Code 和 Message */
|
||||
$data = [
|
||||
'code' => $exception->getCode(),
|
||||
'message' => Config::get('show_error_msg') ? $exception->getMessage() : Config::get('error_message')
|
||||
'message' => Config::get('show_error_msg') ? $exception->getMessage() : Config::get('error_message'),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -137,7 +136,7 @@ class Error
|
||||
* @param Array $vars 异常信息
|
||||
* @return null
|
||||
*/
|
||||
public static function output(\Exception $exception, Array $vars)
|
||||
public static function output(\Exception $exception, array $vars)
|
||||
{
|
||||
if ($exception instanceof Exception) {
|
||||
http_response_code($exception->getHttpStatus());
|
||||
@@ -155,7 +154,7 @@ class Error
|
||||
// 输出异常内容
|
||||
Response::send($data, $type, Config::get('response_return'));
|
||||
} else {
|
||||
ob_end_clean();
|
||||
//ob_end_clean();
|
||||
extract($vars);
|
||||
include Config::get('exception_tmpl');
|
||||
}
|
||||
@@ -195,7 +194,7 @@ class Error
|
||||
|
||||
$source = [
|
||||
'first' => $first,
|
||||
'source' => array_slice($contents, $first - 1, 19)
|
||||
'source' => array_slice($contents, $first - 1, 19),
|
||||
];
|
||||
} catch (Exception $e) {
|
||||
$source = [];
|
||||
|
||||
Reference in New Issue
Block a user