Exceptions¶
gd.py has stable exception system, which leads better understanding of errors. Below is a list of current existing exceptions.
Exception List¶
-
class
gd.GDException[source]¶ Base exception class for gd.py. This could be caught to handle any exceptions thrown from this library.
-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
class
gd.HTTPException[source]¶ Base exception class for errors that are thrown when operation in
HTTPClientfails.-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
class
gd.HTTPError(origin: BaseException)[source]¶ Exception that is raised when exception in
HTTPClientoccurs.-
property
origin¶ The original exception that was raised.
- Type
-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
property
-
class
gd.HTTPStatusError(status: int, reason: Optional[Any])[source]¶ Exception that is raised when error status code is returned. Error codes are considered to be
4XX(client errors) and5XX(server errors).-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
class
gd.ClientException[source]¶ Base exception class for errors that are thrown when operation in
Clientfails.-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
class
gd.MissingAccess[source]¶ Exception that is raised when server responses with an error.
-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
class
gd.SongRestricted(id: int)[source]¶ Exception that is raised when server returns an error when looking for a song.
-
property
id¶ ID of the song that is restricted.
-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
property
-
class
gd.LoginFailure(name: str, password: str)[source]¶ Exception that is raised when server returns an error when trying to log in.
-
property
name¶ Username that was wrong or password did not match.
-
property
password¶ Password that login was failed with.
-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
property
-
class
gd.NothingFound(instance_name: str)[source]¶ Exception that is raised when server returns nothing. It is raised by
HTTPClient, and automatically handled byClient.So, if one is working on lower level, i.e.
HTTPClientorSession, they should handle it as well.-
property
instance_name¶ Name of the class instances of which were not found.
-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
property
-
class
gd.DataException[source]¶ Base exception class for errors that are raised when parsing RobTop’s data fails.
-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
class
gd.DeError(data: str, index: U, field: Optional[Field], origin: Optional[BaseException])[source]¶ Exception that is raised if deserializing data fails.
-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
class
gd.SerError(data: T, index: U, field: Optional[Field], origin: Optional[BaseException])[source]¶ Exception that is raised when serializing data fails.
-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
Exception Hierarchy¶
GDException(Exception)ClientExceptionNotLoggedError