This commit is contained in:
its.kstyagi@gmail.com
2026-09-04 20:56:18 +00:00
commit 1022f24c34
43 changed files with 6160 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
"""Application-specific failures with predictable command-line handling."""
from __future__ import annotations
class UvmError(Exception):
"""An expected error that should be rendered without a traceback."""
def __init__(self, message: str, exit_code: int = 1) -> None:
super().__init__(message)
self.exit_code = exit_code
class ConfigurationError(UvmError):
"""Raised when local uvm configuration is invalid."""
class ValidationError(UvmError):
"""Raised when a command argument is invalid."""
class StateError(UvmError):
"""Raised when persisted VM state cannot be safely used."""
class CommandError(UvmError):
"""Raised when a required host command cannot be executed successfully."""
class FirecrackerError(UvmError):
"""Raised when Firecracker cannot be started or configured."""
class TapCreationError(UvmError):
"""Raised when TAP setup fails after creating a host interface."""
def __init__(self, message: str, *, tap_created: bool) -> None:
super().__init__(message)
self.tap_created = tap_created