gidgethub
— Exceptions
Exceptions
- exception gidgethub.ValidationFailure[source]
An exception representing failed validation of a webhook event.
Inherits from
GitHubException
.
- exception gidgethub.HTTPException(status_code, *args)[source]
A general exception to represent HTTP responses. Inherits from
GitHubException
. The status_code is expected to be anhttp.HTTPStatus
enum value.- status_code
The
http.HTTPStatus
status code that the exception represents.
- exception gidgethub.RedirectionException[source]
Exception for 3XX HTTP responses.
Inherits from
HTTPException
.
- exception gidgethub.BadRequest[source]
Exception for 4XX HTTP responses.
Inherits from
HTTPException
.
- exception gidgethub.BadRequestUnknownError[source]
Exception for
422
status code responses which do not include a JSON response.Added in version XXX.
- response
The response as returned by GitHub.
- exception gidgethub.RateLimitExceeded(rate_limit)[source]
Raised when one’s rate limit has been reached. A subclass of
BadRequest
.Added in version 2.0.
- exception gidgethub.InvalidField(errors, *args)[source]
Raised when a field in a request is invalid.
Inherits from
BadRequest
and explicitly specifies a422
status code. Details of what fields were invalid are stored in theerrors
attribute.- errors
A list of error details for each field which was invalid.
- exception gidgethub.ValidationError(errors, *args)[source]
A request was unable to be completed.
Inherits from
BadRequest
a 422 HTTP response.- errors
Error details.
- exception gidgethub.GitHubBroken[source]
An exception representing 5XX HTTP responses.
Inherits from
HTTPException
.
GraphQL-specific
- exception gidgethub.GraphQLException(message, response)[source]
Base exception for all GraphQL-related exceptions.
Inherits from
GitHubException
.- response
The decoded JSON response from GitHub.
- exception gidgethub.BadGraphQLRequest(status_code, response)[source]
A 4XX HTTP response to a GraphQL request.
Inherits from
GraphQLException
.- response
The decoded JSON response from GitHub.
- exception gidgethub.GraphQLAuthorizationFailure(response)[source]
A 401 HTTP response due to an authorization failure.
Inherits from
BadGraphQLRequest
.
- exception gidgethub.QueryError(response)[source]
An exception representing an error relating to the GraphQL query itself.
Inherits from
GraphQLException
.
- exception gidgethub.GraphQLResponseTypeError(content_type, response)[source]
An exception raised when a GraphQL query response is not JSON.
Inherits from
GraphQLException
.- content_type
The value of the content-type header in the response from GitHub.
- response
The decoded response value from GitHub.