Skip to content

Commit

Permalink
fix(wei, Error): 解决错误时,使用 response 对象发送响应缺少 header 的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
twinh committed Dec 17, 2021
1 parent cf70590 commit 884e114
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* A service that handles exception and display pretty exception message
*
* @mixin \LoggerMixin
* @mixin \ResponseMixin
* @mixin \ResMixin
* @mixin \ReqMixin
*/
class Error extends Base
Expand Down Expand Up @@ -222,7 +222,7 @@ public function internalHandleException(Throwable $e)

try {
// The flowing services may throw exception too
$this->response->setStatusCode($code)->send();
$this->res->setStatusCode($code)->send();
$this->logger->log($level, $e);

$this->displayException($e, $debug);
Expand Down Expand Up @@ -465,7 +465,7 @@ protected function getDisplayMessage($e, $debug)
return $this->{'message' . $e->getCode()};
}

if ($message = $this->response->getStatusTextByCode($e->getCode())) {
if ($message = $this->res->getStatusTextByCode($e->getCode())) {
return $message;
}

Expand Down

0 comments on commit 884e114

Please sign in to comment.