When Vonage returns a 204 response a JSONDecodeError exception is raised.
Expected Behavior
On an 204 response without a body HttpClient's _parse_response should return None.
Current Behavior
_parse_response raises JSONDecodeError
Possible Solution
_parse_response catches json.JSONDecodeError instead of requests.JSONDecodeError missing the fallback logic that returns None
Steps to Reproduce (for bugs)
Call _parse_response over a Response 204 object without body.
Context
Sometimes Vonage calls crash because the response is not parsed correctly to we have to add extra exception handling to the logic.
Your Environment
- vonage version: 4.4.3
- vonage-http-client version: 1.5.1
When Vonage returns a 204 response a
JSONDecodeErrorexception is raised.Expected Behavior
On an 204 response without a body
HttpClient's_parse_responseshould returnNone.Current Behavior
_parse_responseraises JSONDecodeErrorPossible Solution
_parse_responsecatchesjson.JSONDecodeErrorinstead ofrequests.JSONDecodeErrormissing the fallback logic that returnsNoneSteps to Reproduce (for bugs)
Call
_parse_responseover aResponse204 object without body.Context
Sometimes Vonage calls crash because the response is not parsed correctly to we have to add extra exception handling to the logic.
Your Environment