From 4145e082b0ce962d3f9659bbfee6bd72e818d738 Mon Sep 17 00:00:00 2001 From: ctexthuang Date: Tue, 12 Nov 2024 16:34:06 +0800 Subject: [PATCH] feat : 500 --- app/Exception/Handler/AppExceptionHandler.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Exception/Handler/AppExceptionHandler.php b/app/Exception/Handler/AppExceptionHandler.php index df5faca..1410419 100644 --- a/app/Exception/Handler/AppExceptionHandler.php +++ b/app/Exception/Handler/AppExceptionHandler.php @@ -34,11 +34,11 @@ class AppExceptionHandler extends ExceptionHandler $this->log->error(sprintf('%s[%s] in %s', $throwable->getMessage(), $throwable->getLine(), $throwable->getFile())); $this->log->error($throwable->getTraceAsString()); - $result = $this->return->error('Internal Server Error.'); - return $response->withHeader("Content-Type", "application/json") - ->withStatus(200) - ->withBody(new SwooleStream(json_encode($result, JSON_UNESCAPED_UNICODE))); -// return $response->withHeader('Server', 'Hyperf')->withStatus(500)->withBody(new SwooleStream('Internal Server Error.')); +// $result = $this->return->error('Internal Server Error.'); +// return $response->withHeader("Content-Type", "application/json") +// ->withStatus(200) +// ->withBody(new SwooleStream(json_encode($result, JSON_UNESCAPED_UNICODE))); + return $response->withHeader('Server', 'Hyperf')->withStatus(500)->withBody(new SwooleStream('Internal Server Error.')); } public function isValid(Throwable $throwable): bool