# Generated by sila2.code_generator; sila2.__version__: 0.10.3
from __future__ import annotations

from typing import Optional

from sila2.framework.errors.defined_execution_error import DefinedExecutionError

from .pausecontroller_feature import PauseControllerFeature


class InvalidCommandExecutionUUID(DefinedExecutionError):
    def __init__(self, message: Optional[str] = None):
        if message is None:
            message = "The given Command Execution UUID does not specify a command that is currently being executed."
        super().__init__(
            PauseControllerFeature.defined_execution_errors["InvalidCommandExecutionUUID"], message=message
        )


class InvalidCommandState(DefinedExecutionError):
    def __init__(self, message: Optional[str] = None):
        if message is None:
            message = "The specified command is not in a valid state to perform the operation (Pause or Resume)."
        super().__init__(PauseControllerFeature.defined_execution_errors["InvalidCommandState"], message=message)


class OperationNotSupported(DefinedExecutionError):
    def __init__(self, message: Optional[str] = None):
        if message is None:
            message = "The operation (Pause or Resume) is not supported for the SiLA 2 command which the\n      specified Command Execution UUID belongs to."
        super().__init__(PauseControllerFeature.defined_execution_errors["OperationNotSupported"], message=message)
