[rpc] Log the error type on connection error.
Log the exception class type so that a useful message is logged even
if the exception has no message:
I0304 21:05:28.011813 connection.py:325] Connection attempt 1 =
I0304 21:05:28.135140 connection.py:325] Connection attempt 2 =
Issue
@@ -322,7 +322,9 @@ class ManagedConnection(Connection):
channel_ready.result(timeout=wait_secs)
break
except (grpc.FutureTimeoutError, grpc.RpcError) as e:
- logger.debug("Connection attempt %d = %s", attempts, e)
+ logger.debug(
+ "Connection attempt %d = %s %s", attempts, type(e).__name__, str(e)
+ )
wait_secs *= 1.2
else:
self.process.kill()
@@ -375,7 +377,9 @@ class UnmanagedConnection(Connection):
channel_ready.result(timeout=wait_secs)
break
except (grpc.FutureTimeoutError, grpc.RpcError) as e:
- logger.debug("Connection attempt %d = %s", attempts, e)
+ logger.debug(
+ "Connection attempt %d = %s %s", attempts, type(e).__name__, str(e)
+ )
wait_secs *= 1.2
else:
raise TimeoutError(
