Skip to content

errors

This module contains various exceptions used by the project.

UnwrapError

Bases: WomError

Raised when calling unwrap() or unwrap_err() incorrectly.

Parameters:

Name Type Description Default
message str

The error message.

required
Source code in wom/errors.py
class UnwrapError(WomError):
    """Raised when calling [`unwrap()`][wom.Result.unwrap] or
    [`unwrap_err()`][wom.Result.unwrap_err] incorrectly.

    Args:
        message: The error message.
    """

    __slots__ = ()

    def __init__(self, message: str) -> None:
        super().__init__(f"Unwrap failed: {message}")

WomError

Bases: Exception

The base error all wom errors inherit from.

Source code in wom/errors.py
class WomError(Exception):
    """The base error all wom errors inherit from."""

    __slots__ = ()