mirror of
https://github.com/ZettaIO/restic-compose-backup.git
synced 2025-09-28 14:45:23 +00:00
Properly log exceptions
This commit is contained in:
@@ -24,6 +24,7 @@ def send(subject: str = None, body: str = None, alert_type: str = 'INFO'):
|
||||
)
|
||||
except Exception as ex:
|
||||
logger.error("Exception raised when sending alert [%s]: %s", instance.name, ex)
|
||||
logger.exception(ex)
|
||||
|
||||
if len(alert_classes) == 0:
|
||||
logger.info("No alerts configured")
|
||||
|
@@ -51,6 +51,6 @@ class SMTPAlert(BaseAlert):
|
||||
server.sendmail(self.user, self.to, msg.as_string())
|
||||
logger.info('Email sent')
|
||||
except Exception as ex:
|
||||
logger.error(ex)
|
||||
logger.exception(ex)
|
||||
finally:
|
||||
server.close()
|
||||
|
Reference in New Issue
Block a user