1
2
8
10 """
11 I am raised whenever a backend is required for an inexisting package.
12 """
13 pass
14
16 """
17 I am raised whenever an attempt is made to bind a Package instance to a
18 backend already bound, or to create an existing (bound or not) Package.
19 The message can either be the other Package instance, if available, or the
20 package backend url.
21 """
23 if isinstance(self.message, basestring):
24 return self.message
25 else:
26 return self.message._id
27 pass
28
30 """I am raised whenever a backend encounters an internal error.
31
32 I wrap the original exception, if any, as my second argument.
33 """
34 - def __init__(self, msg, original_exception=None, *args):
35 self.args = (msg, original_exception) + args
37 return "%s\nOriginal message:\n%s" % self.args[:2]
38
39
40
42 """Failure code of a claims_for_* method.
43
44 A ClaimFailure always has a False truth value. Furthermore, it has an
45 ``exception`` attribute containing, if not None, an exception explaining
46 the failure.
47 """
48
50 self.exception = exception
51
54
56 return "ClaimFailure(%r)" % self.exception
57