This commit is contained in:
2021-01-07 15:01:06 +08:00
parent e34b577031
commit acd0339b59
+2 -2
View File
@@ -40,12 +40,12 @@ class OnRequest extends Callback
if ($req->is('favicon.ico')) {
return \send(null, 404);
}
\router()->dispatch();
return \router()->dispatch();
} catch (ExitException | Error | \Throwable $exception) {
if ($exception instanceof ExitException) {
return \send($exception->getMessage(), $exception->getCode());
}
$this->sendErrorMessage($exception);
return $this->sendErrorMessage($exception);
} finally {
write(Json::encode(get_object_vars($request)), 'request');
$this->onAfter();