Revision 9510701d commissioning/exception.py
b/commissioning/exception.py | ||
---|---|---|
9 | 9 |
else: |
10 | 10 |
call_error = str(call_error) |
11 | 11 |
cls = CallError.exceptions.get(call_error, cls) |
12 |
self = Exception.__new__(cls, *args)
|
|
12 |
self = Exception.__new__(cls) |
|
13 | 13 |
return self |
14 | 14 |
|
15 | 15 |
def __init__(self, *args, **kw): |
... | ... | |
17 | 17 |
self.args = args |
18 | 18 |
|
19 | 19 |
def __str__(self): |
20 |
return '\n--------\n'.join(self.args) |
|
20 |
return '\n--------\n'.join(str(x) for x in self.args)
|
|
21 | 21 |
|
22 | 22 |
def __repr__(self): |
23 |
return '%s(%s)' % (self.__class__.__name__, ','.join(self.args)) |
|
23 |
return '%s(%s)' % (self.__class__.__name__, |
|
24 |
','.join(str(x) for x in self.args)) |
|
24 | 25 |
|
25 | 26 |
@classmethod |
26 | 27 |
def from_exception(cls, exc): |
... | ... | |
74 | 75 |
@register_exception |
75 | 76 |
class InvalidDataError(CallError): |
76 | 77 |
pass |
77 |
|
|
78 |
register_exceptions(CorruptedError, InvalidDataError) |
|
79 |
|
Also available in: Unified diff