This commit is contained in:
2021-03-30 12:03:05 +08:00
parent fdbcc8f763
commit 8f7306eca1
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -96,7 +96,7 @@ class OnRequest extends Callback
*/ */
protected function sendErrorMessage($sRequest, $sResponse, $exception): bool|string protected function sendErrorMessage($sRequest, $sResponse, $exception): bool|string
{ {
$this->addError($exception->getMessage(),'throwable'); $this->addError($exception,'throwable');
if ($sResponse instanceof Response) { if ($sResponse instanceof Response) {
[$sRequest, $sResponse] = [HRequest::create($sRequest), HResponse::create($sResponse)]; [$sRequest, $sResponse] = [HRequest::create($sRequest), HResponse::create($sResponse)];
} }
+1 -1
View File
@@ -592,7 +592,7 @@ class Node extends HttpService
} }
return $this->runWith(...func_get_args()); return $this->runWith(...func_get_args());
} catch (Throwable $throwable) { } catch (Throwable $throwable) {
$this->addError($throwable->getMessage(),'throwable'); $this->addError($throwable,'throwable');
return Json::to(401, $throwable->getMessage()); return Json::to(401, $throwable->getMessage());
} }
} }
+1 -1
View File
@@ -59,7 +59,7 @@ class Consumer extends Process
Consumer::addTask($crontab); Consumer::addTask($crontab);
} }
} catch (\Throwable $throwable) { } catch (\Throwable $throwable) {
logger()->addError($throwable->getMessage(),'throwable'); logger()->addError($throwable,'throwable');
} finally { } finally {
fire(Event::SYSTEM_RESOURCE_RELEASES); fire(Event::SYSTEM_RESOURCE_RELEASES);
} }