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

Add AuthError and rescue it with Mongo::Error

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.10.0
    • Affects Version/s: None
    • Component/s: 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@mongodb.com Hana Pearlman
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: