mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进Error类
This commit is contained in:
@@ -141,13 +141,10 @@ class Error
|
||||
*/
|
||||
public static function output($exception, array $vars)
|
||||
{
|
||||
if ($exception instanceof Exception) {
|
||||
http_response_code($exception->getHttpStatus());
|
||||
} else {
|
||||
http_response_code(500);
|
||||
}
|
||||
http_response_code($exception instanceof \Exception ? $exception->getHttpStatus() : 500);
|
||||
|
||||
$type = Config::get('default_return_type');
|
||||
|
||||
if (IS_API && 'html' != $type) {
|
||||
// 异常信息输出监听
|
||||
APP_HOOK && Hook::listen('error_output', $data);
|
||||
|
||||
@@ -54,9 +54,12 @@ class Trace
|
||||
'查询信息' => \think\Db::$queryTimes . ' queries ' . \think\Db::$executeTimes . ' writes ',
|
||||
'缓存信息' => \think\Cache::$readTimes . ' reads,' . \think\Cache::$writeTimes . ' writes',
|
||||
'配置加载' => count(Config::get()),
|
||||
'会话信息' => 'SESSION_ID=' . session_id(),
|
||||
];
|
||||
|
||||
if (session_id()) {
|
||||
$base['会话信息'] = 'SESSION_ID=' . session_id();
|
||||
}
|
||||
|
||||
$info = Debug::getFile(true);
|
||||
|
||||
// 获取调试日志
|
||||
|
||||
Reference in New Issue
Block a user