Can exceptions be raised in dstream.py _send() function rather than using logging to facilitate catching the exception from the callers?
For example when I want to catch and exception with the reason why the sending function failed I cant as the following is sent to stdout rather than raising an exception:
Cannot connect to host some.host.com:10055:
Traceback (most recent call last):
File "/export/home/ez000288.sysadmin/kite/kite_python/lib64/python3.6/site-packages/zappix/dstream.py", line 79, in _send
s = self._get_socket()
File "/export/home/ez000288.sysadmin/kite/kite_python/lib64/python3.6/site-packages/zappix/dstream.py", line 70, in _get_socket
address_family = socket.getaddrinfo(self._ip, self._port)[0][0]
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/socket.py", line 745, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
In the code at this point all I can do is check for result[0] for a 'None' to confirm that it failed, however I dont know the reason as its stdout.
If it raised an exception I could catch this and use the error.