Skip to content

Reference

CustomException

Bases: Exception

Custom exception class for handling errors with specific levels and optional data.

Info

This exception class allows for the specification of an error message, an error level (using the ErrorLevelEnum), and optional additional data that can provide more context about the error.

Parameters:

Name Type Description Default
msg str

The exception message.

required
level ErrorLevelEnum

The error level of the exception.

ERROR
data Any | None

Optional additional data associated with the exception.

None

ErrorLevelEnum

Bases: Enum

Enumeration of error levels with corresponding descriptions.

Info

This enumeration provides a set of predefined error levels, ranging from SUCCESS to CRITICAL, each representing the severity of the message or error.

SUCCESS = 'SUCCESS' class-attribute instance-attribute

Represents a successful operation.

DEBUG = 'DEBUG' class-attribute instance-attribute

Represents debug or diagnostic information.

INFO = 'INFO' class-attribute instance-attribute

Represents informational messages.

WARNING = 'WARNING' class-attribute instance-attribute

Represents warning messages indicating potential issues.

ERROR = 'ERROR' class-attribute instance-attribute

Represents error messages indicating failures.

CRITICAL = 'CRITICAL' class-attribute instance-attribute

Represents critical error messages indicating breaking failures.