File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,36 @@ class IntoDPError(Exception):
2323 pass
2424
2525
26+ class IntoDPGenerationError (IntoDPError ):
27+ """
28+ Raised when there was a failure to generate a transformer method from
29+ a signature.
30+ """
31+ pass
32+
33+
34+ class IntoDPParseError (IntoDPGenerationError ):
35+ """
36+ Raised when there was a failure to parse the signature.
37+ """
38+ _FMT_STR = "failed to parse signature %s"
39+
40+ def __init__ (self , signature , msg = None ): # pragma: no cover
41+ """
42+ Initializer.
43+
44+ :param str signature: the D-Bus signature
45+ :param str msg: an explanatory message
46+ """
47+ self ._signature = signature
48+
49+ def __str__ (self ): # pragma: no cover
50+ if self ._msg :
51+ fmt_str = self ._FMT_STR + ": %s"
52+ return fmt_str % (self ._signature , self ._msg )
53+ return self ._FMT_STR % self ._signature
54+
55+
2656class IntoDPValueError (IntoDPError ):
2757 """ Raised when a parameter has an unacceptable value.
2858
You can’t perform that action at this time.
0 commit comments