mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-23 16:45:35 +08:00
add InterruptException catcher to onRequest
This commit is contained in:
@@ -1,5 +1,13 @@
|
|||||||
# 更新日志(v2 版本)
|
# 更新日志(v2 版本)
|
||||||
|
|
||||||
|
## v2.1.4
|
||||||
|
|
||||||
|
> 更新时间:2021.1.3
|
||||||
|
|
||||||
|
- 修复:启动时会提示丢失类的 bug
|
||||||
|
- 优化:HTTP 响应类如果被使用了则一律返回 false
|
||||||
|
- 优化:PHP Warning 等报错统一样式
|
||||||
|
|
||||||
## v2.1.3
|
## v2.1.3
|
||||||
|
|
||||||
> 更新时间:2021.1.2
|
> 更新时间:2021.1.2
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ use ZM\Context\Context;
|
|||||||
use ZM\Context\ContextInterface;
|
use ZM\Context\ContextInterface;
|
||||||
use ZM\DB\DB;
|
use ZM\DB\DB;
|
||||||
use ZM\Exception\DbException;
|
use ZM\Exception\DbException;
|
||||||
|
use ZM\Exception\InterruptException;
|
||||||
use ZM\Framework;
|
use ZM\Framework;
|
||||||
use ZM\Http\Response;
|
use ZM\Http\Response;
|
||||||
use ZM\Module\QQBot;
|
use ZM\Module\QQBot;
|
||||||
@@ -345,6 +346,8 @@ class ServerEventHandler
|
|||||||
//Console::warning('返回了404');
|
//Console::warning('返回了404');
|
||||||
HttpUtil::responseCodePage($response, 404);
|
HttpUtil::responseCodePage($response, 404);
|
||||||
}
|
}
|
||||||
|
} catch (InterruptException $e) {
|
||||||
|
// do nothing
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$response->status(500);
|
$response->status(500);
|
||||||
Console::info($request->server["remote_addr"] . ":" . $request->server["remote_port"] .
|
Console::info($request->server["remote_addr"] . ":" . $request->server["remote_port"] .
|
||||||
|
|||||||
Reference in New Issue
Block a user