Exceptions

All exceptions raised by asyncprawcore subclass AsyncPrawcoreException, so catching it is sufficient to handle any error originating from asyncprawcore.

Provide exception classes for the asyncprawcore package.

exception asyncprawcore.exceptions.AsyncPrawcoreException

Bases: Exception

Base exception class for exceptions that occur within this package.

exception asyncprawcore.exceptions.BadJSON(response)

Bases: ResponseException

Indicate the response did not contain valid JSON.

Parameters:

response (aiohttp.ClientResponse)

Return type:

None

exception asyncprawcore.exceptions.BadRequest(response)

Bases: ResponseException

Indicate invalid parameters for the request.

Parameters:

response (aiohttp.ClientResponse)

Return type:

None

exception asyncprawcore.exceptions.Conflict(response)

Bases: ResponseException

Indicate a conflicting change in the target resource.

Parameters:

response (aiohttp.ClientResponse)

Return type:

None

exception asyncprawcore.exceptions.Forbidden(response)

Bases: ResponseException

Indicate the authentication is not permitted for the request.

Parameters:

response (aiohttp.ClientResponse)

Return type:

None

exception asyncprawcore.exceptions.InsufficientScope(response)

Bases: ResponseException

Indicate that the request requires a different scope.

Parameters:

response (aiohttp.ClientResponse)

Return type:

None

exception asyncprawcore.exceptions.InvalidInvocation

Bases: AsyncPrawcoreException

Indicate that the code to execute cannot be completed.

exception asyncprawcore.exceptions.InvalidToken(response)

Bases: ResponseException

Indicate that the request used an invalid access token.

Parameters:

response (aiohttp.ClientResponse)

Return type:

None

exception asyncprawcore.exceptions.NotFound(response)

Bases: ResponseException

Indicate that the requested URL was not found.

Parameters:

response (aiohttp.ClientResponse)

Return type:

None

exception asyncprawcore.exceptions.OAuthException(response, error, description=None)

Bases: AsyncPrawcoreException

Indicate that there was an OAuth2 related error with the request.

Parameters:
Return type:

None

exception asyncprawcore.exceptions.Redirect(response)

Bases: ResponseException

Indicate the request resulted in a redirect.

This class adds the attribute path, which is the path to which the response redirects.

Parameters:

response (aiohttp.ClientResponse)

Return type:

None

exception asyncprawcore.exceptions.RequestException(original_exception, request_args, request_kwargs)

Bases: AsyncPrawcoreException

Indicate that there was an error with the incomplete HTTP request.

Parameters:
Return type:

None

exception asyncprawcore.exceptions.ResponseException(response)

Bases: AsyncPrawcoreException

Indicate that there was an error with the completed HTTP request.

Parameters:

response (aiohttp.ClientResponse)

Return type:

None

exception asyncprawcore.exceptions.ServerError(response)

Bases: ResponseException

Indicate issues on the server end preventing request fulfillment.

Parameters:

response (aiohttp.ClientResponse)

Return type:

None

exception asyncprawcore.exceptions.SpecialError(response, resp_dict)

Bases: ResponseException

Indicate syntax or spam-prevention issues.

Parameters:
Return type:

None

exception asyncprawcore.exceptions.TooLarge(response)

Bases: ResponseException

Indicate that the request data exceeds the allowed limit.

Parameters:

response (aiohttp.ClientResponse)

Return type:

None

exception asyncprawcore.exceptions.TooManyRequests(response)

Bases: ResponseException

Indicate that the user has sent too many requests in a given amount of time.

Parameters:

response (aiohttp.ClientResponse)

Return type:

None

exception asyncprawcore.exceptions.URITooLong(response)

Bases: ResponseException

Indicate that the length of the request URI exceeds the allowed limit.

Parameters:

response (aiohttp.ClientResponse)

Return type:

None

exception asyncprawcore.exceptions.UnavailableForLegalReasons(response)

Bases: ResponseException

Indicate that the requested URL is unavailable due to legal reasons.

Parameters:

response (aiohttp.ClientResponse)

Return type:

None