File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55namespace think \Whoops \Hander ;
66
77use think \App ;
8- use think \exception \Handle ;
98use think \Response ;
9+ use think \exception \Handle ;
10+ use think \exception \HttpResponseException ;
1011use think \Whoops \Runner ;
1112use Throwable ;
1213use Whoops \Handler \JsonResponseHandler ;
@@ -26,9 +27,14 @@ public function render($request, Throwable $e): Response
2627 {
2728 // Whoops 接管请求异常
2829 if (config ('whoops.enable ' ) && $ this ->app ->isDebug ()) {
30+
31+ if ($ e instanceof HttpResponseException) {
32+ return $ e ->getResponse ();
33+ }
34+
2935 $ this ->runner ->pushHandler (new PrettyPageHandler ());
3036
31- // 兼容 Cors请求(一些调试接口插件)
37+ // 兼容 Cors请求
3238 if ($ request ->isAjax () || (isset ($ _SERVER ['HTTP_SEC_FETCH_MODE ' ]) && $ _SERVER ['HTTP_SEC_FETCH_MODE ' ] === 'cors ' )) {
3339 $ this ->runner ->pushHandler (new JsonResponseHandler ());
3440 }
You can’t perform that action at this time.
0 commit comments