modify
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user