-
Type: Task
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: Error
Use Case
As a node driver developer
I want error instance checks to be as specific as possible
So that I have a better understanding of what the code is trying to handle and confidence that it is doing the right thing
This is a first step to enabling us to work better with the codebase and understand how the errors are expected to flow through the code - where they come from and exactly what we expect to handle
Dependencies
- It would be best to have
NODE-3363completed so that the new types of MongoDriverError can be used where applicable
Unknowns
- There will be extensive investigation necessary to identify exactly what errors are being handled by those general instanceof MongoError checks
Acceptance Criteria
- Replace every instanceof MongoError check with a more specific error type check wherever possible
- Wherever not possible to use a more specific error, make a code comment explaining why that check has to remain general
Implementation Requirements
- The existing tests should all still pass
Testing Requirements
- Ensure there is a test for every check that is being modified; if there isn't one already for that code pathway, write one
Documentation Requirements
- None
Follow Up Requirements
- If there are cases that prove particularly difficult to replace with specific errors, create a new ticket for each of those