Skip to content

Commit

Permalink
Bew meta approach
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Oct 24, 2019
1 parent e566f04 commit 9790776
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/quorum/exceptions.py
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 9790776

Please sign in to comment.