mirror of
https://github.com/SickGear/SickGear.git
synced 2025-03-13 16:25:05 +00:00
Added exception handling for setting up the smtp connection.
Without the exception handling, a stacktrace is thrown. This resulted in postprocessing failing when e-mailing was not configured properly, resulting in all kind of unexpected behavior, like for ex. source files not cleaned up properly.
This commit is contained in:
parent
1cf0b5f9b2
commit
9bd7e6eb17
1 changed files with 6 additions and 1 deletions
|
@ -176,7 +176,12 @@ class EmailNotifier:
|
|||
def _sendmail(self, host, port, smtp_from, use_tls, user, pwd, to, msg, smtpDebug=False):
|
||||
logger.log('HOST: %s; PORT: %s; FROM: %s, TLS: %s, USER: %s, PWD: %s, TO: %s' % (
|
||||
host, port, smtp_from, use_tls, user, pwd, to), logger.DEBUG)
|
||||
srv = smtplib.SMTP(host, int(port))
|
||||
try:
|
||||
srv = smtplib.SMTP(host, int(port))
|
||||
except Exception as e:
|
||||
self.last_err = '%s' % e
|
||||
return False
|
||||
|
||||
if smtpDebug:
|
||||
srv.set_debuglevel(1)
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue