discord-interactions

Error Exceptions

class interactions.api.error.ErrorFormatter

A customized error formatting script to return specific errors.

exception interactions.api.error.InteractionException(_InteractionException__type: Optional[Union[int, enum.IntEnum]] = 0, **kwargs)

An exception class for interactions.

Note

This is a WIP. This isn’t meant to be used yet, this is a baseline, and for extensive testing/review before integration. Likewise, this will show the concepts before use, and will be refined when time goes on.

Variables
  • _formatter (interactions.api.error.ErrorFormatter) – The built in formatter.

  • _lookup (dict) – A dictionary containing the values from the built-in Enum.

static lookup() dict

From the default error enum integer declaration, generate a dictionary containing the phrases used for the errors.

property type: Optional[Union[int, enum.IntEnum]]

Grabs the type attribute. Primarily useful to use it in conditions for integral v4 (potential) logic.

error() None

This calls the exception.

exception interactions.api.error.GatewayException(_GatewayException__type, **kwargs)

This is a derivation of InteractionException in that this is used to represent Gateway closing OP codes.

Variables
  • _formatter (interactions.api.error.ErrorFormatter) – The built in formatter.

  • _lookup (dict) – A dictionary containing the values from the built-in Enum.

static lookup() dict

From the default error enum integer declaration, generate a dictionary containing the phrases used for the errors.

exception interactions.api.error.HTTPException(_HTTPException__type, **kwargs)

This is a derivation of InteractionException in that this is used to represent HTTP Exceptions.

Variables
  • _formatter (interactions.api.error.ErrorFormatter) – The built in formatter.

  • _lookup (dict) – A dictionary containing the values from the built-in Enum.

static lookup() dict

From the default error enum integer declaration, generate a dictionary containing the phrases used for the errors.

exception interactions.api.error.JSONException(_JSONException__type, **kwargs)

This is a derivation of InteractionException in that this is used to represent JSON API Exceptions.

Variables
  • _formatter (interactions.api.error.ErrorFormatter) – The built in formatter.

  • _lookup (dict) – A dictionary containing the values from the built-in Enum.

static lookup() dict

From the default error enum integer declaration, generate a dictionary containing the phrases used for the errors.