-
Type: Improvement
-
Resolution: Fixed
-
Priority: Minor - P4
-
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.
- is duplicated by
-
RUBY-3092 BSON::ObjectId::Invalid does not extend BSON::Error
- Closed