From 7953706895bdfca071160a499e2f0de80ef66de1 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Fri, 24 May 2024 16:18:33 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=20(#533)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/handle/handle_exception.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/common/handle/handle_exception.py b/apps/common/handle/handle_exception.py index d3e86401b..417e3b259 100644 --- a/apps/common/handle/handle_exception.py +++ b/apps/common/handle/handle_exception.py @@ -65,11 +65,13 @@ def find_err_detail(exc_detail): return find_err_detail(_value) elif isinstance(_value, ErrorDetail): return _value - elif isinstance(_value, dict): + elif isinstance(_value, dict) and len(_value.keys()) > 0: return find_err_detail(_value) if isinstance(exc_detail, list): for v in exc_detail: - return find_err_detail(v) + r = find_err_detail(v) + if r is not None: + return r def handle_exception(exc, context):