Wrap exceptions caused by parsers in ParseError in request wrapper#9453
Wrap exceptions caused by parsers in ParseError in request wrapper#9453sevdog wants to merge 1 commit intoencode:masterfrom
Conversation
auvipy
left a comment
There was a problem hiding this comment.
the change seems reasonable. can you fix the lint error please?
|
Looking at request.py, it looks like there is already a precedent for handling this type of error with the
I've opened another PR (#9455) that utilizes this context manager through a |
3640913 to
c375e15
Compare
can you please check the approach followed here please? #9455 |
|
@auvipy yes, that may work better. I can also point out that the I belive that "wrapping" the response may not be an optimal solution (I got in the past errors when handling with DRF requests in non-DRF code which was expecting an instance of Than I close this PR in favor or #9455. |
|
PS: I am curious to see if the same issue would be raised by |
Description
To address #9433 (which is caused by python/cpython#90143) simply wraps
AttributeErrorswhich are raised in the parse process into aParseError.