Initial implementation

This commit is contained in:
2026-05-14 11:32:25 +02:00
parent 6fd1ff7581
commit 916a895a85
31 changed files with 1461 additions and 21 deletions

View File

@@ -0,0 +1,25 @@
from __future__ import annotations
from dataclasses import dataclass, field
from typing import Any
@dataclass
class InfospaceError(Exception):
"""Structured application error suitable for CLI and API surfaces."""
code: str
message: str
detail: dict[str, Any] = field(default_factory=dict)
def __post_init__(self) -> None:
super().__init__(self.message)
def to_dict(self) -> dict[str, Any]:
return {
"error": {
"code": self.code,
"message": self.message,
"detail": self.detail,
}
}