improve error log

This commit is contained in:
HgO 2022-07-17 00:29:36 +02:00
parent 073cde37db
commit 8dd72a6416

View file

@ -229,13 +229,15 @@ class Callbacks:
if event.sender == self.config.user_id: if event.sender == self.config.user_id:
return return
if event.redacts not in self.cache:
logger.warning(f"Error removing silence from reaction {event.redacts}")
return
logger.debug( logger.debug(
f"Read alert event ID for redacted event {event.redacts} from cache" f"Read alert event ID for redacted event {event.redacts} from cache"
) )
if event.redacts not in self.cache:
logger.warning(
f"Unable to remove silences from event {event.redacts}: Redacted event is not in cache"
)
return
alert_event_id: str = self.cache[event.redacts] alert_event_id: str = self.cache[event.redacts]
try: try: