-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 0.2.0
-
Component/s: Error Handling
In converting tools from 0.1.0 to 0.2.0, I have to fix many 'document is nil' errors now that nil can't be use for an empty document. The problem is that the error message has no additional context that would make it easier to tell what function has the problem.
For example: here's code from Find:
f, err := transformDocument(coll.registry, filter) if err != nil { return nil, err }
It would help users debug if they had additional context like this:
f, err := transformDocument(coll.registry, filter) if err != nil { return nil, fmt.Errorf("invalid filter in Find: %v", err) }
This lack of context is probably in many more places – but the scope of this ticket is intended to cover invalid use of nil documents.
- duplicates
-
GODRIVER-1854 Make "ErrNilDocument" and "ErrNilValue" more specific
- Backlog