Skip to content

Commit 1202fb6

Browse files
committed
Fix message format in validation exception handler
1 parent 8591d4e commit 1202fb6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backend/common/exception/exception_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ async def _validation_exception_handler(request: Request, exc: RequestValidation
5252
if not ctx:
5353
error['msg'] = custom_message
5454
else:
55-
error['msg'] = custom_message.format(**ctx)
5655
ctx_error = ctx.get('error')
5756
if ctx_error:
57+
error['msg'] = custom_message.format(**ctx)
5858
error['ctx']['error'] = (
5959
ctx_error.__str__().replace("'", '"') if isinstance(ctx_error, Exception) else None
6060
)

0 commit comments

Comments
 (0)