Errors

HTTP

class HTTPException(status: int, message: str)

Bases: Exception

Raised when an HTTP error occurs.

Parameters:
  • status (int) – The error code of the HTTP error.

  • message (int) – The message of the HTTP error

status: int

The error code of the HTTP error.

message: str

The message of the HTTP error.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

args
with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class NotFound(status: int, message: str)

Bases: HTTPException

Raised when the resource you tried to access was not found.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

args
with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

status: int

The error code of the HTTP error.

message: str

The message of the HTTP error.

class Forbidden(status: int, message: str)

Bases: HTTPException

Raised when you are forbidden from the resource you tried to access.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

args
with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

status: int

The error code of the HTTP error.

message: str

The message of the HTTP error.

class Unauthorized(status: int, message: str)

Bases: HTTPException

Raised when the server could not authenticate your identity.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

args
with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

status: int

The error code of the HTTP error.

message: str

The message of the HTTP error.

class ImproperToken(status: int, message: str)

Bases: HTTPException

Raised when an improper token was passed when calling Bot.start().

add_note(object, /)

Exception.add_note(note) – add a note to the exception

args
with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

status: int

The error code of the HTTP error.

message: str

The message of the HTTP error.

Gateway

class GatewayError(status: int, message: str)

Bases: Exception

Raised when a Gateway error occurs.

Parameters:
  • status (int) – The error code of the Gateway error.

  • message (int) – The message of the Gateway error

status: int

The error code of the Gateway error.

message: str

The message of the Gateway error.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

args
with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.