Coverage for src / lexigram / contracts / admin / errors.py: 100%
14 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-08-15 18:58 +0800
« prev ^ index » next coverage.py v7.13.5, created at 2026-08-15 18:58 +0800
1"""Admin contract errors — base exceptions for the admin domain.
3Leaf exceptions live in lexigram-admin, not here. Admin errors are returned as
4frozen dataclass values in Result.Err(), not raised as exceptions.
5"""
7from __future__ import annotations
9from dataclasses import dataclass
11from lexigram.contracts.exceptions.base import LexigramError
14class AdminError(LexigramError):
15 """Base exception for all admin-domain errors.
17 Extended by leaf exceptions in lexigram-admin.
18 """
20 _code = "LEX_ERR_ADMIN_001"
23@dataclass(frozen=True, slots=True)
24class WidgetNotFoundError:
25 """Returned as ``Err(WidgetNotFoundError(...))`` when a contributor
26 cannot render a requested widget.
28 Frozen immutable value type for use as error payload in Result.Err().
29 """
31 contributor_name: str
32 widget_name: str
35@dataclass(frozen=True, slots=True)
36class HealthCheckNotFoundError:
37 """Returned as ``Err(HealthCheckNotFoundError(...))`` when a contributor
38 cannot execute a requested health check.
40 Frozen immutable value type for use as error payload in Result.Err().
41 """
43 contributor_name: str
44 check_name: str
47__all__ = [
48 "AdminError",
49 "HealthCheckNotFoundError",
50 "WidgetNotFoundError",
51]