diff --git a/etcd3gw/client.py b/etcd3gw/client.py index 7313783..9f2901a 100644 --- a/etcd3gw/client.py +++ b/etcd3gw/client.py @@ -83,7 +83,7 @@ def post(self, *args, **kwargs): if resp.status_code in _EXCEPTIONS_BY_CODE: raise _EXCEPTIONS_BY_CODE[resp.status_code](resp.reason) if resp.status_code != requests.codes['ok']: - raise exceptions.Etcd3Exception(resp.reason, resp.text) + raise exceptions.Etcd3Exception(resp.text, resp.reason) except requests.exceptions.Timeout as ex: raise exceptions.ConnectionTimeoutError(six.text_type(ex)) except requests.exceptions.ConnectionError as ex: diff --git a/etcd3gw/exceptions.py b/etcd3gw/exceptions.py index 00ac8f5..cd9134a 100644 --- a/etcd3gw/exceptions.py +++ b/etcd3gw/exceptions.py @@ -12,8 +12,8 @@ class Etcd3Exception(Exception): - def __init__(self, msg, detail_text=None): - super(Etcd3Exception, self).__init__(msg) + def __init__(self, detail_text=None, *args): + super(Etcd3Exception, self).__init__(*args) self.detail_text = detail_text