-
Type: Improvement
-
Resolution: Done
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
Use Case
As a... node driver developer
I want... straightforward code without multiple levels of error wrapping
So that... I can be confident that the error objects are exactly what they need to be when returned to the user
Dependencies
- None
Unknowns
- What attributes are actually required on the error object that are currently added via the multiple levels of wrapping
Acceptance Criteria
- Simplify the handleWriteConcernError code in bulk/common.ts
- There is a write concern error wrapped in 4 levels of constructors; reduce the number of calls to MongoServerError
- If successful, it should be possible to also remove the plain Error type from the constructor definition for MongoServerError;
- this is desirable because the MongoServerError should be a wrapper for error documents returned from the server, not our own errors
Implementation Requirements
- There should not be any breaking changes
Testing Requirements
- All existing tests should pass
- Add an explicit test for the required shape of the resulting error
Documentation Requirements
- None
Follow Up Requirements
- None
- has to be done before
-
NODE-3365 Remove "code" property from the general MongoError class
- Backlog