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

Improved error messages

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Error Handling
    • Labels:
      None

      Currently, the error messages that can result from socket problems reading a server's response are confusing. For example, this one
      https://github.com/mongodb/mongo-go-driver/blob/ea02175e9e44795efdda597ebd94b11d746d3984/x/mongo/driver/topology/connection.go#L470
      can result in a message like "incomplete read of message header" for a context of "read tcp 192.168.248.6:38030->192.168.248.6:27000: i/o timeout" in response to a socket timeout expiring. This message isn't accurate because this particular function call is reading more than a message header, and because "incomplete" incorrectly implies at least one message header byte was successfully read. Driver consumers should not need to know these items of detail anyway.

      Instead, to make error diagnosis easier for driver consumers, can we change the error messages in this function to be something like "socket error reading server response"? The context that gets appended to this message should have sufficient further detail already.

            Assignee:
            Unassigned Unassigned
            Reporter:
            milkie@mongodb.com Eric Milkie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: