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

Return errors from "description.NewServer" and "fsm.apply"

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • 2.1.0
    • Affects Version/s: None
    • Component/s: None
    • None

      The description.NewServer and fsm.apply functions create or modify server descriptions. Both of those functions set any errors that happen on the returned or modified description.Server struct instead of returning it as part of the function signature. That deviates from typical Go function signatures and can lead to bugs if someone doesn't realize they need to check the LastError field on the returned struct. Update both functions to return errors as well as set the error in the LastError field. Update calling code to check the returned error instead of the error on the description.Server

      Definition of done:

      • Update description.NewServer and fsm.apply to return an error.
      • Update all calling code to check the returned error instead of the description.Server.LastError field.

            Assignee:
            Unassigned Unassigned
            Reporter:
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: