Context
Error messages like
connection() error occurred during connection handshake: EOF
can be confusing to users who don't understand what EOF means. Getting an io.EOF error from reading a network socket always means that the OS closed the network socket for a reason unknown to the Go Driver, so it would be helpful to add that context to the error message.
For example, a better error message would be:
connection() error occurred during connection handshake: connection closed unexpectedly by the other side: EOF
Definition of done
- Wrap io.EOF with an additional error message, like "connection closed unexpectedly by the other side".
- Wrap client-side timeouts with an additional error message, like "client timed out waiting for server response".
- (Optional) Add more specific context for what the Go Driver was doing when an error occurred. For example, there are a number of cases where an error occurs during the connection init and handshake process, but the error message can be extremely similar (see here). We should consider adding a message that says specifically what was going on when an error occurred.
Pitfalls
- The new error messages could confuse users who are expecting the existing error messages.
- causes
-
GODRIVER-3435 Localhost connection fails when `InsecureSkipVerify=true` is set
-
- Closed
-