chore(lint): Use logging.exception instead of logging.error (#10415)
This commit is contained in:
parent
dd5ffaf058
commit
574c4a264f
22 changed files with 31 additions and 30 deletions
|
|
@ -39,13 +39,13 @@ class SMTPClient:
|
|||
|
||||
smtp.sendmail(self._from, mail["to"], msg.as_string())
|
||||
except smtplib.SMTPException as e:
|
||||
logging.error(f"SMTP error occurred: {str(e)}")
|
||||
logging.exception(f"SMTP error occurred: {str(e)}")
|
||||
raise
|
||||
except TimeoutError as e:
|
||||
logging.error(f"Timeout occurred while sending email: {str(e)}")
|
||||
logging.exception(f"Timeout occurred while sending email: {str(e)}")
|
||||
raise
|
||||
except Exception as e:
|
||||
logging.error(f"Unexpected error occurred while sending email: {str(e)}")
|
||||
logging.exception(f"Unexpected error occurred while sending email: {str(e)}")
|
||||
raise
|
||||
finally:
|
||||
if smtp:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue