Mercurial > libervia-backend
comparison sat_frontends/bridge/bridge_frontend.py @ 3715:b9718216a1c0 0.9
merge bookmark 0.9
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 01 Dec 2021 16:13:31 +0100 |
parents | 60d3861e5996 |
children |
comparison
equal
deleted
inserted
replaced
3714:af09b5aaa5d7 | 3715:b9718216a1c0 |
---|---|
26 | 26 |
27 @param name (str): full exception class name (with module) | 27 @param name (str): full exception class name (with module) |
28 @param message (str): error message | 28 @param message (str): error message |
29 @param condition (str) : error condition | 29 @param condition (str) : error condition |
30 """ | 30 """ |
31 Exception.__init__(self) | 31 super().__init__() |
32 self.fullname = str(name) | 32 self.fullname = str(name) |
33 self.message = str(message) | 33 self.message = str(message) |
34 self.condition = str(condition) if condition else "" | 34 self.condition = str(condition) if condition else "" |
35 self.module, __, self.classname = str(self.fullname).rpartition(".") | 35 self.module, __, self.classname = str(self.fullname).rpartition(".") |
36 | 36 |
37 def __str__(self): | 37 def __str__(self): |
38 message = (": %s" % self.message) if self.message else "" | 38 return self.classname + (f": {self.message}" if self.message else "") |
39 return self.classname + message | |
40 | 39 |
41 def __eq__(self, other): | 40 def __eq__(self, other): |
42 return self.classname == other | 41 return self.classname == other |