Skip to content

JSONDecodeError on 204 responses #326

@phb-teleclinic

Description

@phb-teleclinic

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions