-
Type:
Improvement
-
Status: Closed
-
Priority:
Major - P3
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 0.1.0
-
Component/s: None
-
Labels:None
-
Epic Link:
In our encoders and decoders, we currently throw many different types of errors, some of which are redundant or incorrect.
We should update them to throw encodingError, decodingError, logicErrors, internalErrors, or invalidArgumentErrors as necessary.
Also, when encoding/decoding directly to/from a document without the use of BSONEncoder / BSONDecoder (i.e. through BSONValue conformance methods ), we should be throwing appropriate errors. In particular, we should be throwing .logicError s when the user attempts to retrieve a value from a DocumentIterator that doesn't match the current type of the iterator.