This commit is contained in:
2021-03-19 18:23:41 +08:00
parent 60fede47ac
commit eeab6d5078
+6
View File
@@ -581,6 +581,8 @@ class Node extends HttpService
if (!is_array($this->handler)) { if (!is_array($this->handler)) {
return $this->runWith(...func_get_args()); return $this->runWith(...func_get_args());
} }
try {
[$class, $method] = $this->handler; [$class, $method] = $this->handler;
/** @var HttpFilter $filter */ /** @var HttpFilter $filter */
@@ -589,6 +591,10 @@ class Node extends HttpService
if ($validator instanceof Validator && !$validator->validation()) { if ($validator instanceof Validator && !$validator->validation()) {
return Json::to(401, $validator->getError()); return Json::to(401, $validator->getError());
} }
} catch (Throwable $throwable) {
$this->error($throwable->getMessage());
return Json::to(401, $throwable->getMessage());
}
return $this->runWith(...func_get_args()); return $this->runWith(...func_get_args());
} }