Skip to main content

CustomError

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

Constructor

Signature

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

Parameters

NameTypeDescription
codestringThe unique error code identifying the specific error type.
messagestringA descriptive message explaining the details of the error.

Signature

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

Parameters

NameTypeDescription
codestringThe unique identifier string representing the specific error type
messagestringThe human-readable explanation of the error condition

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 source exception instance to be converted into a CustomError

Returns

TypeDescription
[CustomError](customerror.md?sid=flyte_errors_customerror)A new instance of CustomError initialized with the source exception's details and linked via the cause attribute