Create an exception hierarchy

XMLWordPrintableJSON

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

      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 (Inactive)
            Reporter:
            Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: