Base exception for Unity CLI operations. Attributes: code: Optional error code for programmatic handling
| 22 | |
| 23 | |
| 24 | class UnityCLIError(Exception): |
| 25 | """Base exception for Unity CLI operations. |
| 26 | |
| 27 | Attributes: |
| 28 | code: Optional error code for programmatic handling |
| 29 | """ |
| 30 | |
| 31 | def __init__(self, message: str, code: str | None = None) -> None: |
| 32 | super().__init__(message) |
| 33 | self.message = message |
| 34 | self.code = code |
| 35 | |
| 36 | def __str__(self) -> str: |
| 37 | if self.code: |
| 38 | return f"[{self.code}] {self.message}" |
| 39 | return self.message |
| 40 | |
| 41 | |
| 42 | class ConnectionError(UnityCLIError): |
no outgoing calls
no test coverage detected