Skip to content

status ¤

Status ¤

Bases: int, Enum

Enumeration of the possible values that can be used in the return status of functions.

status_for_error ¤

status_for_error(error: Exception) -> Status

Returns a Status that corresponds to the specified error.

status_for_output ¤

status_for_output(output: Any) -> Status

Returns a Status that corresponds to the specified output value.

register_error_type ¤

register_error_type(
    error_type: Type[Exception],
    handler: Callable[[Exception], Status],
)

Register an error type, and a handler which derives a Status from errors of this type.

register_output_type ¤

register_output_type(
    output_type: Type[Any], handler: Callable[[Any], Status]
)

Register an output type, and a handler which derives a Status from outputs of this type.