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

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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Unknown Unknown
    • 2.0.0
    • None
    • None
    • None

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: