Skip to content

Commit

Permalink
perf: 优化错误提示 (#533)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaohuzhang1 authored May 24, 2024
1 parent 2da3199 commit 7953706
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/common/handle/handle_exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 7953706

Please sign in to comment.