This commit is contained in:
as2252258@163.com
2021-03-06 19:03:37 +08:00
parent 85c0631f10
commit 419d966984
+6
View File
@@ -478,6 +478,7 @@ class Router extends HttpService implements RouterInterface
*/
public function dispatch(): mixed
{
try {
if (!($node = $this->find_path(\request()))) {
return send(self::NOT_FOUND);
}
@@ -486,6 +487,11 @@ class Router extends HttpService implements RouterInterface
return null;
}
return $node->afterDispatch($response);
} catch (\Throwable $exception) {
$this->addError($exception);
return send($exception->getMessage(), 200);
}
}