CustomError
This error is raised when the user raises a custom error.
Constructor
Signature
def CustomError(
code: string,
message: string
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| code | string | The unique error code identifying the specific error type. |
| message | string | A descriptive message explaining the details of the error. |
Signature
def CustomError(
code: string,
message: string
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| code | string | The unique identifier string representing the specific error type |
| message | string | The 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
| Name | Type | Description |
|---|---|---|
| e | Exception | The source exception instance to be converted into a CustomError |
Returns
| Type | Description |
|---|---|
[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 |