From c92bc227828f9f8a5e68b78bc34cab66cfb30f86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 9 Mar 2021 10:24:04 +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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/HttpServer/Events/OnRequest.php b/HttpServer/Events/OnRequest.php index 73d6fc37..d7cdeabf 100644 --- a/HttpServer/Events/OnRequest.php +++ b/HttpServer/Events/OnRequest.php @@ -10,6 +10,7 @@ use HttpServer\Exception\ExitException; use HttpServer\Http\Request as HRequest; use HttpServer\Http\Response as HResponse; use ReflectionException; +use Snowflake\Core\Json; use Snowflake\Event; use Snowflake\Exception\ComponentException; use Snowflake\Exception\NotFindClassException; @@ -47,7 +48,7 @@ class OnRequest extends Callback return \send(null); } catch (ExitException | Error | \Throwable $exception) { if ($exception instanceof ExitException) { - return \send($exception->getMessage(), $exception->getCode()); + return \send(Json::to($exception->getCode(), $exception->getMessage())); } return $this->sendErrorMessage($request, $response, $exception); }