Remove unnecessary return statements in Python sockets error handler
This commit is contained in:
@@ -8,25 +8,18 @@ def handle_error(err):
|
|||||||
if err == libzt.ZTS_ERR_SOCKET:
|
if err == libzt.ZTS_ERR_SOCKET:
|
||||||
if errno() == libzt.ZTS_EAGAIN:
|
if errno() == libzt.ZTS_EAGAIN:
|
||||||
raise BlockingIOError()
|
raise BlockingIOError()
|
||||||
return
|
|
||||||
if errno() == libzt.ZTS_EINPROGRESS:
|
if errno() == libzt.ZTS_EINPROGRESS:
|
||||||
raise BlockingIOError()
|
raise BlockingIOError()
|
||||||
return
|
|
||||||
if errno() == libzt.ZTS_EALREADY:
|
if errno() == libzt.ZTS_EALREADY:
|
||||||
raise BlockingIOError()
|
raise BlockingIOError()
|
||||||
return
|
|
||||||
if errno() == libzt.ZTS_ECONNABORTED:
|
if errno() == libzt.ZTS_ECONNABORTED:
|
||||||
raise ConnectionAbortedError()
|
raise ConnectionAbortedError()
|
||||||
return
|
|
||||||
if errno() == libzt.ZTS_ECONNREFUSED:
|
if errno() == libzt.ZTS_ECONNREFUSED:
|
||||||
raise ConnectionRefusedError()
|
raise ConnectionRefusedError()
|
||||||
return
|
|
||||||
if errno() == libzt.ZTS_ECONNRESET:
|
if errno() == libzt.ZTS_ECONNRESET:
|
||||||
raise ConnectionResetError()
|
raise ConnectionResetError()
|
||||||
return
|
|
||||||
if errno() == libzt.ZTS_ETIMEDOUT:
|
if errno() == libzt.ZTS_ETIMEDOUT:
|
||||||
raise TimeoutError()
|
raise TimeoutError()
|
||||||
return
|
|
||||||
raise Exception("ZTS_ERR_SOCKET (" + str(err) + ")")
|
raise Exception("ZTS_ERR_SOCKET (" + str(err) + ")")
|
||||||
if err == libzt.ZTS_ERR_SERVICE:
|
if err == libzt.ZTS_ERR_SERVICE:
|
||||||
raise Exception("ZTS_ERR_SERVICE (" + str(err) + ")")
|
raise Exception("ZTS_ERR_SERVICE (" + str(err) + ")")
|
||||||
|
|||||||
Reference in New Issue
Block a user