From 04360766149517be9f95b324dcd7b0969b88579c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 8 Jun 2021 14:03:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Events/OnRequest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HttpServer/Events/OnRequest.php b/HttpServer/Events/OnRequest.php index e1e7048e..89e78b66 100644 --- a/HttpServer/Events/OnRequest.php +++ b/HttpServer/Events/OnRequest.php @@ -16,6 +16,7 @@ use Snowflake\Snowflake; use Swoole\Error; use Swoole\Http\Request; use Swoole\Http\Response; +use Swoole\Http\Status; use Throwable; /** @@ -101,11 +102,10 @@ class OnRequest extends Callback $sResponse->addHeader('Access-Control-Allow-Headers', $headers); $sResponse->addHeader('Access-Control-Request-Method', $methods); - return $sResponse->send($exception->getMessage(), $exception->getCode()); - if (!($exception instanceof ExitException)) { return $sResponse->send(\logger()->exception($exception), 200); } else { + return $sResponse->send($exception->getMessage(), 200); } }