Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-1818

Improve NoServerAvailable error message

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: None
    • Component/s: None

      In Mongoid we have some error messages that include actionable steps toward resolution, for example:

              ambiguous_relationship:
                message: "Ambiguous associations %{candidates} defined on %{klass}."
                summary:
                  "When Mongoid attempts to set an inverse document of an association
                  in memory, it needs to know which association it belongs to. When
                  setting %{name}, Mongoid looked on the class %{inverse}
                  for a matching association, but multiples were found that could
                  potentially match: %{candidates}."
                resolution: "On the %{name} association on %{inverse} you must add an
                  :inverse_of option to specify the exact association on %{klass}
                  that is the opposite of %{name}."
      

      These are defined in `lib/config/locales/en.yml` in Mongoid.

      We could do something similar for the driver. We already detect dead monitor threads and closed clients for example, and in these cases we can point to our forking guidance (https://docs.mongodb.com/ruby-driver/current/tutorials/ruby-driver-create-client/#usage-with-forking-servers) and to a new section in the docs stating that using closed clients is not supported.

      It may be of value to create an entire section in the tutorial dedicated to NoServerAvailable troubleshooting as this is error probably accounts for the vast majority of all application-surfaced driver exceptions.

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: