Raise appropriate exception from ERROR response.
(self, response: dict[str, Any])
| 381 | raise ProtocolError(f"Unexpected response type: {msg_type}", "PROTOCOL_ERROR") |
| 382 | |
| 383 | def _raise_error(self, response: dict[str, Any]) -> None: |
| 384 | """Raise appropriate exception from ERROR response.""" |
| 385 | error = response.get("error", {}) |
| 386 | code = error.get("code", "UNKNOWN_ERROR") |
| 387 | message = error.get("message", "Unknown error") |
| 388 | |
| 389 | if code in self._INSTANCE_ERROR_CODES: |
| 390 | raise InstanceError(message, code) |
| 391 | if code == "TIMEOUT": |
| 392 | raise TimeoutError(message, code) |
| 393 | raise UnityCLIError(message, code) |
| 394 | |
| 395 | def _handle_success_response(self, response: dict[str, Any], command: str) -> dict[str, Any]: |
| 396 | """Handle successful RESPONSE message.""" |
no test coverage detected