Skip to content

Get HTTP status code error handling #1183

@wmarquardt

Description

@wmarquardt

to improve error handling in the HttpError class, it would be useful to have a simpler way to get the request status code, as a status code property in the class.

eg.

try:
    self.client.snapshots().get(
        project=[project name],
        snapshot=[description]
    ).execute()
except HttpError as err:
    if err.status_code == 404:
        do_something()

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions