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:
ExceptionBase exception class for exceptions that occur within this package.
- exception asyncprawcore.exceptions.BadJSON(response)¶
Bases:
ResponseExceptionIndicate the response did not contain valid JSON.
- Parameters:
response (aiohttp.ClientResponse)
- Return type:
None
- exception asyncprawcore.exceptions.BadRequest(response)¶
Bases:
ResponseExceptionIndicate invalid parameters for the request.
- Parameters:
response (aiohttp.ClientResponse)
- Return type:
None
- exception asyncprawcore.exceptions.Conflict(response)¶
Bases:
ResponseExceptionIndicate a conflicting change in the target resource.
- Parameters:
response (aiohttp.ClientResponse)
- Return type:
None
- exception asyncprawcore.exceptions.Forbidden(response)¶
Bases:
ResponseExceptionIndicate the authentication is not permitted for the request.
- Parameters:
response (aiohttp.ClientResponse)
- Return type:
None
- exception asyncprawcore.exceptions.InsufficientScope(response)¶
Bases:
ResponseExceptionIndicate that the request requires a different scope.
- Parameters:
response (aiohttp.ClientResponse)
- Return type:
None
- exception asyncprawcore.exceptions.InvalidInvocation¶
Bases:
AsyncPrawcoreExceptionIndicate that the code to execute cannot be completed.
- exception asyncprawcore.exceptions.InvalidToken(response)¶
Bases:
ResponseExceptionIndicate that the request used an invalid access token.
- Parameters:
response (aiohttp.ClientResponse)
- Return type:
None
- exception asyncprawcore.exceptions.NotFound(response)¶
Bases:
ResponseExceptionIndicate that the requested URL was not found.
- Parameters:
response (aiohttp.ClientResponse)
- Return type:
None
- exception asyncprawcore.exceptions.OAuthException(response, error, description=None)¶
Bases:
AsyncPrawcoreExceptionIndicate that there was an OAuth2 related error with the request.
- Parameters:
response (aiohttp.ClientResponse)
error (str)
description (str | None)
- Return type:
None
- exception asyncprawcore.exceptions.Redirect(response)¶
Bases:
ResponseExceptionIndicate 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:
AsyncPrawcoreExceptionIndicate that there was an error with the incomplete HTTP request.
- exception asyncprawcore.exceptions.ResponseException(response)¶
Bases:
AsyncPrawcoreExceptionIndicate that there was an error with the completed HTTP request.
- Parameters:
response (aiohttp.ClientResponse)
- Return type:
None
- exception asyncprawcore.exceptions.ServerError(response)¶
Bases:
ResponseExceptionIndicate issues on the server end preventing request fulfillment.
- Parameters:
response (aiohttp.ClientResponse)
- Return type:
None
- exception asyncprawcore.exceptions.SpecialError(response, resp_dict)¶
Bases:
ResponseExceptionIndicate syntax or spam-prevention issues.
- Parameters:
response (aiohttp.ClientResponse)
- Return type:
None
- exception asyncprawcore.exceptions.TooLarge(response)¶
Bases:
ResponseExceptionIndicate that the request data exceeds the allowed limit.
- Parameters:
response (aiohttp.ClientResponse)
- Return type:
None
- exception asyncprawcore.exceptions.TooManyRequests(response)¶
Bases:
ResponseExceptionIndicate 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:
ResponseExceptionIndicate that the length of the request URI exceeds the allowed limit.
- Parameters:
response (aiohttp.ClientResponse)
- Return type:
None
Bases:
ResponseExceptionIndicate that the requested URL is unavailable due to legal reasons.
- Parameters:
response (aiohttp.ClientResponse)
- Return type:
None