Coverage for src / lexigram / contracts / notification / errors.py: 64%
11 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-08-19 05:41 +0800
« prev ^ index » next coverage.py v7.13.5, created at 2026-08-19 05:41 +0800
1# lexigram-contracts/src/lexigram/contracts/notification/errors.py
2"""Notification error types."""
4from __future__ import annotations
6from typing import Any
8from lexigram.contracts.exceptions.domain import DomainError
11class NotificationError(DomainError):
12 """Base for expected, recoverable notification delivery failures.
14 Attributes:
15 channel: Notification channel (e.g. "sms", "push").
16 backend: Name of the backend (e.g. "twilio", "fcm").
17 """
19 _code = "LEX_ERR_NOTIF_001"
21 def __init__(
22 self,
23 message: str = "Notification error",
24 *,
25 channel: str = "unknown",
26 backend: str = "unknown",
27 **kwargs: Any,
28 ) -> None:
29 details = {"backend": backend, "channel": channel, **kwargs.pop("details", {})}
30 super().__init__(message, details=details, **kwargs)
31 self.backend = backend
32 self.channel = channel
35__all__ = ["NotificationError"]