Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-3361

Improve error message when connection is closed by the OS

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Go Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • 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@mongodb.com Qingyang Hu
            Reporter:
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: