summaryrefslogtreecommitdiff
path: root/src/bindings/python/sockets.py
diff options
context:
space:
mode:
authorBoston Walker <[email protected]>2021-12-29 16:23:54 -0500
committerBoston Walker <[email protected]>2021-12-29 16:23:54 -0500
commit3bb2dd4a5265ae98f4c4072be998f563e3adc618 (patch)
treee753893ca1fc5b216fab05ad4021818e1a4f7fa6 /src/bindings/python/sockets.py
parenta4d2a83e7ee7d8a4596b27e389f537ec215bc519 (diff)
Revert "#150 - cleaned up socket error messages"
This reverts commit 293f92355a37b5d47774e850a9c22be874447b7d.
Diffstat (limited to 'src/bindings/python/sockets.py')
-rwxr-xr-xsrc/bindings/python/sockets.py17
1 files changed, 8 insertions, 9 deletions
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: