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

Create an exception hierarchy

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • bson-5.0.0
    • Affects Version/s: None
    • Component/s: BSON
    • None
    • Major Change

      Currently bson-ruby defines a number of exception classes deriving from RuntimeError, as well as uses several standard exceptions (RangeError, ArgumentError, TypeError) in various parts of BSON serialization and deserialization. There is no base class like Mongo::Error that an application can rescue to catch all BSON-related exceptions.

      In BSON 4, we can create a base class derived from RuntimeError which all non-standard BSON exceptions will derive from. Rescuing this base class will not catch all exceptions but it is a good intermediate step.

      For BSON 5 we can consider whether replacing RangeError, ArgumentError and TypeError usage in bson-ruby should be replaced by BSON-specific exceptions, and the base class should be derived from StandardError rather than RuntimeError.

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

              Created:
              Updated:
              Resolved: