maubot-ntfy/ntfy/exceptions.py

9 lines
351 B
Python

class SubscriptionError(Exception):
"""Raised when an error occurs while subscribing to a ntfy topic."""
def __init__(self, http_response: dict) -> None:
self._http_message = http_response
self.message = self._http_message.get("error")
self.code = self._http_message.get("code")
super().__init__(self.message)