diff options
| author | Boston Walker <[email protected]> | 2021-12-29 16:23:54 -0500 |
|---|---|---|
| committer | Boston Walker <[email protected]> | 2021-12-29 16:23:54 -0500 |
| commit | 3bb2dd4a5265ae98f4c4072be998f563e3adc618 (patch) | |
| tree | e753893ca1fc5b216fab05ad4021818e1a4f7fa6 /src | |
| parent | a4d2a83e7ee7d8a4596b27e389f537ec215bc519 (diff) | |
Revert "#150 - cleaned up socket error messages"
This reverts commit 293f92355a37b5d47774e850a9c22be874447b7d.
Diffstat (limited to 'src')
| -rwxr-xr-x | src/bindings/python/libzt.py | 1 | ||||
| -rwxr-xr-x | src/bindings/python/sockets.py | 17 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/bindings/python/libzt.py b/src/bindings/python/libzt.py index 09d980b..963bf43 100755 --- a/src/bindings/python/libzt.py +++ b/src/bindings/python/libzt.py @@ -189,6 +189,7 @@ ZTS_IOC_VOID = _libzt.ZTS_IOC_VOID ZTS_IOC_OUT = _libzt.ZTS_IOC_OUT ZTS_IOC_IN = _libzt.ZTS_IOC_IN ZTS_IOC_INOUT = _libzt.ZTS_IOC_INOUT + class zts_node_info_t(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr diff --git a/src/bindings/python/sockets.py b/src/bindings/python/sockets.py index 9afcc0b..d91fe3a 100755 --- a/src/bindings/python/sockets.py +++ b/src/bindings/python/sockets.py @@ -6,22 +6,21 @@ import libzt def handle_error(err): """Convert libzt error code to exception""" if err == libzt.ZTS_ERR_SOCKET: - sock_err = errno() - if sock_err == libzt.zts_errno_t.ZTS_EAGAIN: + if errno() == libzt.ZTS_EAGAIN: raise BlockingIOError() - if sock_err == libzt.zts_errno_t.ZTS_EINPROGRESS: + if errno() == libzt.ZTS_EINPROGRESS: raise BlockingIOError() - if sock_err == libzt.zts_errno_t.ZTS_EALREADY: + if errno() == libzt.ZTS_EALREADY: raise BlockingIOError() - if sock_err == libzt.zts_errno_t.ZTS_ECONNABORTED: + if errno() == libzt.ZTS_ECONNABORTED: raise ConnectionAbortedError() - if sock_err == libzt.zts_errno_t.ZTS_ECONNREFUSED: + if errno() == libzt.ZTS_ECONNREFUSED: raise ConnectionRefusedError() - if sock_err == libzt.zts_errno_t.ZTS_ECONNRESET: + if errno() == libzt.ZTS_ECONNRESET: raise ConnectionResetError() - if sock_err == libzt.zts_errno_t.ZTS_ETIMEDOUT: + if errno() == libzt.ZTS_ETIMEDOUT: raise TimeoutError() - raise ConnectionError(libzt.zts_errno_t(sock_err).name + " (" + str(sock_err) + ")") + raise Exception("ZTS_ERR_SOCKET (" + str(err) + ")") if err == libzt.ZTS_ERR_SERVICE: raise Exception("ZTS_ERR_SERVICE (" + str(err) + ")") if err == libzt.ZTS_ERR_ARG: |
