Exceptions in Async PRAW¶
In addition to exceptions under the asyncpraw.exceptions namespace shown below,
exceptions might be raised that inherit from asyncprawcore.AsyncPrawcoreException.
Please see the following resource for information on those exceptions:
https://github.com/praw-dev/asyncprawcore/blob/main/asyncprawcore/exceptions.py
asyncpraw.exceptions¶
Async PRAW exception classes.
Includes two main exceptions: RedditAPIException for when something goes wrong
on the server side, and ClientException when something goes wrong on the
client side. Both of these classes extend AsyncPRAWException.
All other exceptions are subclassed from ClientException.
- exception asyncpraw.exceptions.AsyncPRAWException¶
The base Async PRAW Exception that all other exception classes extend.
- __init__(*args, **kwargs)¶
- add_note(note, /)¶
Add a note to the exception
- with_traceback(tb, /)¶
Set self.__traceback__ to tb and return self.
- exception asyncpraw.exceptions.ClientException¶
Indicate exceptions that don’t involve interaction with Reddit’s API.
- __init__(*args, **kwargs)¶
- add_note(note, /)¶
Add a note to the exception
- with_traceback(tb, /)¶
Set self.__traceback__ to tb and return self.
- exception asyncpraw.exceptions.DuplicateReplaceException¶
Indicate exceptions that involve the replacement of
MoreComments.- Return type:
None
- __init__()¶
Initialize a
DuplicateReplaceExceptioninstance.- Return type:
None
- add_note(note, /)¶
Add a note to the exception
- with_traceback(tb, /)¶
Set self.__traceback__ to tb and return self.
- exception asyncpraw.exceptions.InvalidFlairTemplateID(template_id)¶
Indicate exceptions where an invalid flair template ID is given.
- Parameters:
template_id (str)
- Return type:
None
- __init__(template_id)¶
Initialize an
InvalidFlairTemplateIDinstance.- Parameters:
template_id (str)
- Return type:
None
- add_note(note, /)¶
Add a note to the exception
- with_traceback(tb, /)¶
Set self.__traceback__ to tb and return self.
- exception asyncpraw.exceptions.InvalidImplicitAuth¶
Indicate exceptions where an implicit auth type is used incorrectly.
- Return type:
None
- __init__()¶
Initialize an
InvalidImplicitAuthinstance.- Return type:
None
- add_note(note, /)¶
Add a note to the exception
- with_traceback(tb, /)¶
Set self.__traceback__ to tb and return self.
- exception asyncpraw.exceptions.InvalidURL(url, *, message='Invalid URL: {}')¶
Indicate exceptions where an invalid URL is entered.
- __init__(url, *, message='Invalid URL: {}')¶
Initialize an
InvalidURLinstance.
- add_note(note, /)¶
Add a note to the exception
- with_traceback(tb, /)¶
Set self.__traceback__ to tb and return self.
- exception asyncpraw.exceptions.MediaPostFailed¶
Indicate exceptions where media uploads failed..
- Return type:
None
- __init__()¶
Initialize a
MediaPostFailedinstance.- Return type:
None
- add_note(note, /)¶
Add a note to the exception
- with_traceback(tb, /)¶
Set self.__traceback__ to tb and return self.
- exception asyncpraw.exceptions.MissingRequiredAttributeException¶
Indicate exceptions caused by not including a required attribute.
- __init__(*args, **kwargs)¶
- add_note(note, /)¶
Add a note to the exception
- with_traceback(tb, /)¶
Set self.__traceback__ to tb and return self.
- exception asyncpraw.exceptions.ReadOnlyException¶
Raised when a method call requires
read_onlymode to be disabled.- __init__(*args, **kwargs)¶
- add_note(note, /)¶
Add a note to the exception
- with_traceback(tb, /)¶
Set self.__traceback__ to tb and return self.
- exception asyncpraw.exceptions.RedditAPIException(items)¶
Container for error messages from Reddit’s API.
- Parameters:
items (list[RedditErrorItem | list[str] | str])
- Return type:
None
- __init__(items)¶
Initialize a
RedditAPIExceptioninstance.- Parameters:
items (
list[RedditErrorItem|list[str] |str]) – Either a list of instances ofRedditErrorItemor a list containing lists of unformed errors.- Return type:
None
- add_note(note, /)¶
Add a note to the exception
- staticmethod parse_exception_list(exceptions)¶
Covert an exception list into a
RedditErrorItemlist.- Return type:
- Parameters:
exceptions (list[RedditErrorItem | list[str]])
- with_traceback(tb, /)¶
Set self.__traceback__ to tb and return self.
- class asyncpraw.exceptions.RedditErrorItem(error_type, *, field=None, message=None)¶
Represents a single error returned from Reddit’s API.
- __init__(error_type, *, field=None, message=None)¶
Initialize a
RedditErrorIteminstance.
- exception asyncpraw.exceptions.TooLargeMediaException(*, actual, maximum_size)¶
Indicate exceptions from uploading media that’s too large.
- __init__(*, actual, maximum_size)¶
Initialize a
TooLargeMediaExceptioninstance.
- add_note(note, /)¶
Add a note to the exception
- with_traceback(tb, /)¶
Set self.__traceback__ to tb and return self.
- exception asyncpraw.exceptions.WebSocketException(message)¶
Indicate exceptions caused by use of WebSockets.
- Parameters:
message (str)
- Return type:
None
- __init__(message)¶
Initialize a
WebSocketExceptioninstance.- Parameters:
message (
str) – The exception message.- Return type:
None
- add_note(note, /)¶
Add a note to the exception
- with_traceback(tb, /)¶
Set self.__traceback__ to tb and return self.