mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-17 10:13:56 -05:00
Merge pull request #475 from syntonym/master
Catch IMAP connection errors
This commit is contained in:
commit
2cd077d12d
@ -216,7 +216,11 @@ class MailFetcher(Loggable):
|
|||||||
return r
|
return r
|
||||||
|
|
||||||
def _connect(self):
|
def _connect(self):
|
||||||
self._connection = imaplib.IMAP4_SSL(self._host, self._port)
|
try:
|
||||||
|
self._connection = imaplib.IMAP4_SSL(self._host, self._port)
|
||||||
|
except OSError as e:
|
||||||
|
msg = "Problem connecting to {}: {}".format(self._host, e.strerror)
|
||||||
|
raise MailFetcherError(msg)
|
||||||
|
|
||||||
def _login(self):
|
def _login(self):
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user