This commit is contained in:
2021-04-16 19:00:14 +08:00
parent 52783f3f72
commit d4698db767
+5 -2
View File
@@ -541,12 +541,15 @@ class Node extends HttpService
}
if (!$validator->validation()) {
return Json::to(401, $validator->getError());
return Json::to(5005, $validator->getError());
}
return $this->runWith(...func_get_args());
} catch (Throwable $throwable) {
$this->addError($throwable, 'throwable');
return Json::to(401, $throwable->getMessage());
$code = $throwable->getCode() == 0 ? 500 : $throwable->getCode();
return Json::to($code, $throwable->getMessage());
}
}