# 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 .simulationcontroller_feature import SimulationControllerFeature


class StartSimulationModeFailed(DefinedExecutionError):
    def __init__(self, message: Optional[str] = None):
        if message is None:
            message = "The server cannot change to Simulation Mode.\n      This error can, e.g., be thrown, if a real-world process needs to be ended before switching to simulation\n      mode."
        super().__init__(
            SimulationControllerFeature.defined_execution_errors["StartSimulationModeFailed"], message=message
        )


class StartRealModeFailed(DefinedExecutionError):
    def __init__(self, message: Optional[str] = None):
        if message is None:
            message = "The server cannot change to Real Mode.\n      This error can, e.g., be thrown, if a device is not ready to change into Real Mode."
        super().__init__(SimulationControllerFeature.defined_execution_errors["StartRealModeFailed"], message=message)
