Raise the typed PIN exception for a PIN-gate verdict; otherwise the generic :class:`AgentStreamError` (the ask stream's error-frame contract).
(code: str, message: str)
| 34 | |
| 35 | |
| 36 | def _stream_error(code: str, message: str) -> CmdopError: |
| 37 | """Raise the typed PIN exception for a PIN-gate verdict; otherwise the |
| 38 | generic :class:`AgentStreamError` (the ask stream's error-frame contract).""" |
| 39 | if code in _TYPED_STREAM_ERROR_CODES: |
| 40 | return map_core_error(code, message) |
| 41 | return AgentStreamError(code or "internal", message or "") |
| 42 | |
| 43 | if TYPE_CHECKING: |
| 44 | from collections.abc import AsyncIterator |
no test coverage detected