log more details on command error

This commit is contained in:
HgO 2022-07-08 23:22:31 +02:00
parent 9b26d6b2ae
commit c9b1dfde13

View file

@ -94,7 +94,7 @@ class Command:
alert_fingerprint, duration, self.room.user_name(self.event.sender)
)
except (AlertNotFoundError, AlertmanagerError) as e:
logger.error(f"Unable to create silence: {e}")
logger.exception(f"Unable to create silence: {e}", exc_info=e)
continue
count_created_silences += 1
@ -128,7 +128,7 @@ class Command:
try:
await self.alertmanager.delete_silence(alert_fingerprint)
except (AlertNotFoundError, SilenceNotFoundError, AlertmanagerError) as e:
logger.error(f"Unable to delete silence: {e}")
logger.exception(f"Unable to delete silence: {e}", exc_info=e)
continue
count_removed_silences += 1