ErrorCode
class ErrorCode
Bases: Enum
Categories: error
Abstract base for connector error-code enums.
Concrete subclasses declare variants whose values are ErrorDef
instances. Call exception to render a template and raise the
bound exception.
Examples
raise MysqlErrorCode.MYSQL_5.exception(
cause=sqlalchemy_err, uri=conn.uri,
)
Methods
method
messagedef message(**kwargs: Any = {}) -> str
Render this code's message template without raising.
Parameters:
method
exceptiondef exception(cause: Exception | None = None, **kwargs: Any = {}) -> 'TabsdataException'
Build a TabsdataException for this code.
Parameters:
parameter
causeException | NoneUnderlying exception to chain via __cause__ (the
framework also sets __suppress_context__ so the
traceback reads as raise ... from cause).
parameter
**kwargsAnySubstituted into the message template; surplus keys
are stashed on the exception's extra.
Returns:
The bound TabsdataException subclass instance, ready to