wrappers.py:129: BadRequest flask:2.0.3 #4508
-
Hi, I fixed flask version from 2.0.0 to 2.0.3 because I encountered the same problem #4341 After above fixing, I try to debug below statement.
best regards. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
app/views/error_handler.py:18: in custom_client_error_handler
current_app.logger.warning(exception, extra=dict(extra_data=to_extra_data()))
app/views/error_handler.py:46: in to_extra_data
json_body=request.json,
/usr/local/lib/python3.8/site-packages/werkzeug/wrappers/request.py:540: in json
return self.get_json() Looks like you have a In pallets/werkzeug#2355, accessing So you could change line |
Beta Was this translation helpful? Give feedback.
Looks like you have a
custom_client_error_handler
method that callsto_extra_data
for logging. That callsrequest.json
unconditionally.In pallets/werkzeug#2355, accessing
json
now raises a 400 error instead of returningNone
if the request is not well formed. You can usesilent=True
to make it returnNone
instead, or you can userequest.is_json
instead to check if t…