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
« prev ^ index » next coverage.py v7.16.0, created at 2026-09-06 15:42 +0000
1"""
2Exceptions for the notification system.
3"""
6class NotificationError(Exception):
7 """Base exception for notification-related errors."""
9 pass
12class ServiceError(NotificationError):
13 """Error related to notification service configuration or validation."""
15 pass
18class SecurityBlockError(ServiceError):
19 """A confirmed send-time SSRF/DNS-rebind block.
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 """
31 pass
34class SendError(NotificationError):
35 """Error occurred while sending a notification."""
37 pass
40class RateLimitError(NotificationError):
41 """Rate limit exceeded for notifications."""
43 pass