Skip to main content

CustomError

This error is raised when the user raises a custom error.

Constructor

Signature

def CustomError(
code: str,
message: str
) - > null

Parameters

NameTypeDescription
codestrThe error code.
messagestrThe error message.

Methods


from_exception()

@classmethod
def from_exception(
e: Exception
) - > [CustomError](customerror.md?sid=flyte_errors_customerror)

Create a CustomError from an exception. The exception's class name is used as the error code and the exception message is used as the error message.

Parameters

NameTypeDescription
eExceptionThe exception object from which to create the CustomError. Its class name will be the error code and its message will be the error message.

Returns

TypeDescription
[CustomError](customerror.md?sid=flyte_errors_customerror)A new CustomError instance populated with details from the provided exception.