Add AuthError and rescue it with Mongo::Error

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 2.10.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently, auth errors (Mongo::Auth::InvalidMechanism and Mongo::Auth::Unauthorized) derive from RuntimeError and not from Mongo::Error. As a result, code which rescues Mongo::Error for recovery or defining exception propagation boundaries does not function correctly when auth fails (and the auth exceptions are raised). To fix this:

      1. Add the Mongo::Error::AuthError, derived from RuntimeError.
      2. Change InvalidMechanism and Unauthorized to derive from Mongo::Error::AuthError.
      3. Audit the entire driver for rescues of Mongo::Error and, if appropriate, also rescue AuthError.

              Assignee:
              Hana Pearlman
              Reporter:
              Oleg Pudeyev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: