"""Event-related exceptions."""


class UnsupportedAwaitUserBlockError(Exception):
    """Raised when the built-in stream handler encounters an await_user block other than text input.

    The built-in stream handler (used when the agent is invoked directly, not via the stream
    server) only supports input_request. For buttons, slider, date picker forms, etc., run the
    agent using the stream server (web UI) via the `yera` CLI.
    """

    def __init__(self, block_type: str) -> None:
        self.block_type = block_type
        super().__init__(
            f"Block type {block_type!r} is not supported by the built-in stream handler. "
            "Run this agent using the stream server (web UI) via the `yera` CLI."
        )
