Skip to content

Parsing a 504 error #103

@FabioFleitas

Description

@FabioFleitas

Hey guys,
Sometimes we receive a HTTP 504 response error that is not appropriately being caught. In parse_response when you call payload = resp.json(), it will throw a ValueError("No JSON object could be decoded") error.

What I'm thinking of adding before payload = resp.json():

if resp.status_code == 504:
    raise error.APIConnectionError(resp.content,
        resp.content, resp.status_code, resp)

Thoughts? Happy to submit a PR if you think this is good.

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