X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=python%2Fovs%2Fdb%2Ferror.py;h=882518cb11604cca4c56f67001ed00e3f9a89d0a;hb=0f9fc40325e390f23ef46cb2b3588da6b97ad5b1;hp=084db6e2e8ecf14e2568f499a34e54a36891d013;hpb=991559357f6a03c3a5b70c053c8c2554aa8d5ee4;p=sliver-openvswitch.git diff --git a/python/ovs/db/error.py b/python/ovs/db/error.py index 084db6e2e..882518cb1 100644 --- a/python/ovs/db/error.py +++ b/python/ovs/db/error.py @@ -16,7 +16,6 @@ import ovs.json class Error(Exception): def __init__(self, msg, json=None, tag=None): - Exception.__init__(self) self.msg = msg self.json = json if tag is None: @@ -27,8 +26,8 @@ class Error(Exception): else: self.tag = tag - def __str__(self): + # Compose message. syntax = "" if self.json is not None: syntax = "syntax \"%s\": " % ovs.json.to_string(self.json) - return "%s%s: %s" % (syntax, self.tag, self.msg) + Exception.__init__(self, "%s%s: %s" % (syntax, self.tag, self.msg))