Skip to content

Mispell and return instead of raise Exception on status different then 200 #4

@dk-WZFinTech

Description

@dk-WZFinTech

This line:

return resp.json(['error'])

has bad construction should be:

      return resp.json()['error']

but IMO this should be change to:

        resp = requests.get(url)
        if resp.status_code == 200:
            return resp.json()
        else:
            error = resp.json()['error']
            raise Exception(f"Web status: {resp.status_code} - {error}")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions