Package conduit :: Module Exceptions
[hide private]

Source Code for Module conduit.Exceptions

 1  """ 
 2  Exceptions used to convey information during the sync process 
 3   
 4  Copyright: John Stowers, 2006 
 5  License: GPLv2 
 6  """ 
 7   
8 -class ConversionError(Exception):
9 """ 10 Exception thrown by TypeConverter when it could not convert stuff due to an 11 error in the conversion function 12 """
13 - def __init__(self, fromType, toType):
14 self.fromType = fromType 15 self.toType = toType 16 Exception.__init__(self, 17 "Could not convert: %s -> %s" % (self.fromType, self.toType) 18 )
19
20 -class ConversionDoesntExistError(Exception):
21 """ 22 Thrown when the typeconverter tries a conversion that does not exist 23 """
24 - def __init__(self, fromType, toType):
25 self.fromType = fromType 26 self.toType = toType 27 Exception.__init__(self, 28 "No conversion exists: %s -> %s" % (self.fromType, self.toType) 29 )
30
31 -class RefreshError(Exception):
32 """ 33 Exception thrown upon failure to refresh conduit 34 """ 35 pass
36
37 -class NotSupportedError(Exception):
38 """ 39 Exception thrown when a dataprovider cannot be loaded 40 """ 41 pass
42
43 -class SyncronizeError(Exception):
44 """ 45 Non-fatal, i.e. dont stop the whole sync process, just ignore this 46 one particular attempt to get() a resource as failed 47 """ 48 pass
49
50 -class SyncronizeFatalError(Exception):
51 """ 52 Fatal error returned from sync. Do not attempt again 53 """ 54 pass
55
56 -class SynchronizeConflictError(Exception):
57 """ 58 Raised in the put() method when the input data conflicts with data 59 already present and user intervention is needed to resolve 60 """
61 - def __init__(self, comparison, fromData, toData):
62 self.comparison = comparison 63 self.fromData = fromData 64 self.toData = toData 65 Exception.__init__(self, 66 "Comparison=%s (From: %s, To:%s)" % (self.comparison, self.fromData, self.toData) 67 )
68
69 -class StopSync(Exception):
70 """ 71 Raised by the syncworker to tell the syncmanager to stop 72 """
73 - def __init__(self, step=0):
74 self.step = step 75 Exception.__init__(self, 76 "Sync aborted at step %s" % self.step 77 )
78