# 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 .cancelcontroller_feature import CancelControllerFeature


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__(
            CancelControllerFeature.defined_execution_errors["InvalidCommandExecutionUUID"], message=message
        )


class OperationNotSupported(DefinedExecutionError):
    def __init__(self, message: Optional[str] = None):
        if message is None:
            message = (
                "Canceling is not supported for the SiLA 2 Command with the\n      specified CommandExecutionUUID."
            )
        super().__init__(CancelControllerFeature.defined_execution_errors["OperationNotSupported"], message=message)
