gidgethub — Exceptions

Exceptions

exception gidgethub.GitHubException

Base exception for this library.

exception gidgethub.ValidationFailure

An exception representing failed validation of a webhook event.

Inherits from GitHubException.

exception gidgethub.HTTPException(status_code, *args)

A general exception to represent HTTP responses. Inherits from GitHubException. The status_code is expected to be an http.HTTPStatus enum value.

status_code

The status code that the exception represents.

exception gidgethub.RedirectionException

Exception for 3XX HTTP responses.

Inherits from HTTPException.

exception gidgethub.BadRequest

Exception for 4XX HTTP responses.

Inherits from HTTPException.

exception gidgethub.RateLimitExceeded(rate_limit)

Raised when one’s rate limit has been reached. A subclass of BadRequest.

New in version 2.0.

rate_limit

The RateLimit object with the rate limit details which triggered the raising of the exception.

exception gidgethub.InvalidField(errors, *args)

Raised when a field in a request is invalid.

Inherits from BadRequest and explicitly specifies a 422 status code. Details of what fields were invalid are stored in the errors attribute.

errors

A list of error details for each field which was invalid.

exception gidgethub.GitHubBroken

An exception representing 5XX HTTP responses.

Inherits from GitHubException.