Improve error message when connection is closed by the OS

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 2.3.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Go Drivers
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Qingyang Hu
            Reporter:
            Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: