File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -46,15 +46,15 @@ async def _validation_exception_handler(exc: RequestValidationError | Validation
4646 if i18n .current_language != 'en-US' :
4747 custom_message = t (f'pydantic.{ error ["type" ]} ' )
4848 if custom_message :
49- ctx = error .get ('ctx' )
50- if not ctx :
49+ error_ctx = error .get ('ctx' )
50+ if not error_ctx :
5151 error ['msg' ] = custom_message
5252 else :
53- ctx_error = ctx .get ('error' )
54- if ctx_error :
55- error ['msg' ] = custom_message .format (** ctx )
53+ e = error_ctx .get ('error' )
54+ if e :
55+ error ['msg' ] = custom_message .format (** error_ctx )
5656 error ['ctx' ]['error' ] = (
57- ctx_error .__str__ ().replace ("'" , '"' ) if isinstance (ctx_error , Exception ) else None
57+ e .__str__ ().replace ("'" , '"' ) if isinstance (e , Exception ) else None
5858 )
5959 errors .append (error )
6060 error = errors [0 ]
You can’t perform that action at this time.
0 commit comments