File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,38 @@ 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+ # pylint: disable=super-init-not-called
48+ self ._signature = signature
49+ self ._msg = msg
50+
51+ def __str__ (self ): # pragma: no cover
52+ if self ._msg :
53+ fmt_str = self ._FMT_STR + ": %s"
54+ return fmt_str % (self ._signature , self ._msg )
55+ return self ._FMT_STR % self ._signature
56+
57+
2658class IntoDPValueError (IntoDPError ):
2759 """ Raised when a parameter has an unacceptable value.
2860
You can’t perform that action at this time.
0 commit comments