MCPcopy
hub / github.com/OfflineIMAP/offlineimap / OfflineImapError

Class OfflineImapError

offlineimap/error.py:1–39  ·  view source on GitHub ↗

An Error during offlineimap synchronization

Source from the content-addressed store, hash-verified

1class OfflineImapError(Exception):
2 """An Error during offlineimap synchronization"""
3
4 class ERROR:
5 """Severity level of an Exception
6
7 * **MESSAGE**: Abort the current message, but continue with folder
8 * **FOLDER_RETRY**: Error syncing folder, but do retry
9 * **FOLDER**: Abort folder sync, but continue with next folder
10 * **REPO**: Abort repository sync, continue with next account
11 * **CRITICAL**: Immediately exit offlineimap
12 """
13
14 MESSAGE, FOLDER_RETRY, FOLDER, REPO, CRITICAL = 0, 10, 15, 20, 30
15
16 def __init__(self, reason, severity, errcode=None):
17 """
18 :param reason: Human readable string suitable for logging
19
20 :param severity: denoting which operations should be
21 aborted. E.g. a ERROR.MESSAGE can occur on a faulty
22 message, but a ERROR.REPO occurs when the server is
23 offline.
24
25 :param errcode: optional number denoting a predefined error
26 situation (which let's us exit with a predefined exit
27 value). So far, no errcodes have been defined yet.
28
29 :type severity: OfflineImapError.ERROR value"""
30
31 self.errcode = errcode
32 self.severity = severity
33
34 # 'reason' is stored in the Exception().args tuple.
35 super(OfflineImapError, self).__init__(reason)
36
37 @property
38 def reason(self):
39 return self.args[0]

Callers 15

selectMethod · 0.90
openMethod · 0.90
__init__Method · 0.90
__plainhandlerMethod · 0.90
__xoauth2handlerMethod · 0.90
__start_tlsMethod · 0.90
__authn_loginMethod · 0.90
__authn_helperMethod · 0.90
acquireconnectionMethod · 0.90
__lockMethod · 0.90
__syncMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected