1"""Closed errors safe to return through the Decky RPC bridge."""23from __future__ import annotations456class ControllerError(Exception):7 """An expected appliance-controller failure with a non-secret code."""89 def __init__(self, code: str, detail: str | None = None):10 super().__init__(code)11 self.code = code12 # A non-secret diagnostic describing *why* this failure occurred, when13 # the code alone would hide the root cause (e.g. a readiness timeout14 # that swallowed the last polling error). Never returned across the RPC15 # bridge — only logged host-side — so it stays independent of the16 # frontend-facing `code` contract.17 self.detail = detail