Skip to content

Errors module

ConfigValidationError

CLI exception indicating that the configuration file was not valid

__init__(self, cause) special

Parameters:

Name Type Description Default
cause ValidationError

Pydantic validation error that caused validation to fail.

required
Source code in simulation/errors.py
def __init__(self, cause: ValidationError):
    """
    Args:
        cause: Pydantic validation error that caused validation to fail.
    """
    formated_errors = display_errors(cause.errors())
    super().__init__(
        f"Failed to validate the configuration file.\n{formated_errors}"
    )
    self.__cause__ = cause

SkipSectionError

Utility exception to indicate that a task section should be skipped

StatemachineFactoryLoadError

CLI Exception indicating that a sm factory plugin could not be loaded

__init__(self, factory_name) special

Parameters:

Name Type Description Default
factory_name str

The name of the factory that failed to load

required
Source code in simulation/errors.py
def __init__(self, factory_name: str):
    """
    Args:
        factory_name: The name of the factory that failed to load
    """
    super().__init__(message=f"Failed to load sm factory: '{factory_name}'")

StatemachineFactoryTypeError

CLI Exception indicating that a type error occurred while loading a sm factory plugin.

__init__(self, factory_type) special

Parameters:

Name Type Description Default
factory_type Type

The python type of the factory that could not be loaded.

required
Source code in simulation/errors.py
def __init__(self, factory_type: Type):
    """
    Args:
        factory_type: The python type of the factory that could not be loaded.
    """
    super().__init__(
        message=f"Failed to load sm factory plugin got invalid type: '{factory_type}'"
    )

TransitionExecutionError

Base class for errors that occur during state transitions

__init__(self, message, cause=None, fallback_state=None) special

Parameters:

Name Type Description Default
message str

The error message

required
cause Optional[Exception]

The underlying cause of the transition error.

None
fallback_state Optional[str]

Optionally the name of the state to fallback to.

None
Source code in simulation/errors.py
def __init__(
    self,
    message: str,
    cause: Optional[Exception] = None,
    fallback_state: Optional[str] = None,
):
    """
    Args:
        message: The error message
        cause: The underlying cause of the transition error.
        fallback_state: Optionally the name of the state to fallback to.
    """
    super().__init__(message)
    self.cause = cause
    self.fallback_state = fallback_state