Coverage for src/local_deep_research/notifications/exceptions.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.16.0, created at 2026-09-06 15:42 +0000

1""" 

2Exceptions for the notification system. 

3""" 

4 

5 

6class NotificationError(Exception): 

7 """Base exception for notification-related errors.""" 

8 

9 pass 

10 

11 

12class ServiceError(NotificationError): 

13 """Error related to notification service configuration or validation.""" 

14 

15 pass 

16 

17 

18class SecurityBlockError(ServiceError): 

19 """A confirmed send-time SSRF/DNS-rebind block. 

20 

21 Raised instead of the plain ``ServiceError`` used for pre-dispatch URL 

22 validation rejects. It is a ``ServiceError`` subclass so every existing 

23 ``except ServiceError`` / ``pytest.raises(ServiceError)`` still catches 

24 it and the non-transient INVALID_URL classification is unchanged — this 

25 subclass exists only so callers that want to tell "malformed/blocked 

26 URL at validation time" apart from "destination confirmed hostile at 

27 send time" (e.g. to pick a more accurate user-facing message) can do so 

28 without parsing exception text. 

29 """ 

30 

31 pass 

32 

33 

34class SendError(NotificationError): 

35 """Error occurred while sending a notification.""" 

36 

37 pass 

38 

39 

40class RateLimitError(NotificationError): 

41 """Rate limit exceeded for notifications.""" 

42 

43 pass