diff --git a/src/quorum/exceptions.py b/src/quorum/exceptions.py index 7ef4cc43..832c2f90 100644 --- a/src/quorum/exceptions.py +++ b/src/quorum/exceptions.py @@ -56,6 +56,7 @@ class BaseError(RuntimeError): def __init__(self, message): RuntimeError.__init__(self, message) self.message = message + self.meta = None self._uid = None @property @@ -64,6 +65,15 @@ def uid(self): self._uid = uuid.uuid4() return self._uid + def set_meta(self, name, value): + if not self.meta: self.meta = {} + self.meta[name] = value + + def del_meta(self, name): + if not self.meta: return + if not name in self.meta: return + del self.meta[name] + class ServerInitError(BaseError): """ The server initialization error that represents a