Initial commit

This commit is contained in:
notifier committed 2026-11-15 15:01:15 +00:00
commit 6b4f1e2eb4
20 files changed
+806

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
from typing import ClassVar
class GenericError(Exception):
"""Base class for every GENERIC error the API can explain to a client."""
status_code: ClassVar[int] = 502
code: ClassVar[str] = "sm_upstream_error"
client_visible: ClassVar[bool] = False
@property
def client_message(self) -> str:
return str(self) if self.client_visible else "The GENERIC entry could not be checked right now, please try again later"
@property
def headers(self) -> dict[str, str]:
"""Extra HTTP headers the proxy should send with this error."""
return {}