Coverage for sdks / stigmem-py / src / stigmem / exceptions.py: 100%
10 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-05-25 01:49 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-05-25 01:49 +0000
1"""Stigmem client exceptions."""
3from __future__ import annotations
6class StigmemError(Exception):
7 """Base exception for all stigmem client errors."""
10class StigmemHTTPError(StigmemError):
11 """An HTTP error response from the stigmem node."""
13 def __init__(self, status_code: int, detail: str) -> None:
14 super().__init__(f"HTTP {status_code}: {detail}")
15 self.status_code = status_code
16 self.detail = detail
19class StigmemAuthError(StigmemHTTPError):
20 """401/403 from the node."""
23class StigmemNotFoundError(StigmemHTTPError):
24 """404 from the node."""
27class StigmemConflictError(StigmemHTTPError):
28 """409 from the node (e.g. duplicate peer)."""