From a6f0e386c0e48d7a73212f84769b06c23bc96eaa Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 6 Apr 2022 08:50:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=BAhttp=E7=9B=B8?= =?UTF-8?q?=E5=BA=94=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/utils/exceptions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/utils/exceptions.py b/apps/utils/exceptions.py index 57d57569..e05aabd8 100644 --- a/apps/utils/exceptions.py +++ b/apps/utils/exceptions.py @@ -35,7 +35,8 @@ def custom_exception_hander(exc, context): if isinstance(exc.detail, (list, dict)): data = {'err_detail':exc.detail} - data['err_codes'] = exc.get_codes() + data['err_code'] = exc.default_code + data['err_msg'] = exc.default_detail else: data = {'err_msg': exc.detail, 'err_code':exc.get_codes()}