Coverage for src/lexigram/notification/delivery/exceptions.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.15.4, created at 2026-08-26 02:32 +0800

1"""Exceptions for notification delivery.""" 

2 

3from __future__ import annotations 

4 

5from lexigram.contracts.notification.errors import NotificationError 

6 

7 

8class PermanentDeliveryFailure(NotificationError): # noqa: N818 

9 """Raised when a message has exhausted all delivery retries. 

10 

11 Args: 

12 delivery_id: The delivery record ID that failed permanently. 

13 """ 

14 

15 _code = "LEX_ERR_NOTIF_011" 

16 

17 def __init__(self, delivery_id: str) -> None: 

18 super().__init__( 

19 f"Permanent delivery failure for delivery_id={delivery_id}", 

20 channel="unknown", 

21 backend="unknown", 

22 ) 

23 self.delivery_id = delivery_id 

24 

25 

26__all__ = ["PermanentDeliveryFailure"]