-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Major Change
The current ErrNilDocument and ErrNilValue error values sometimes leave users confused because the errors don't say anything about what part of the input document or value was nil. Replace all uses of ErrNilDocument and ErrNilValue with a new error type InvalidArgumentError that gives more information about why the input is invalid (e.g. "id field cannot be nil" or "document at index 4 is nil").
Definition of done:
- Remove ErrNilDocument and ErrNilValue.
- Add a new type InvalidArgumentError that
- Make the new InvalidArgumentError satisfy the errors.Is and errors.As APIs by implementing Is and As functions.
- Update all uses of ErrNilDocument and ErrNilValue to return an InvalidArgumentError with additional information about what part of the input was invalid.
Open questions:
- Should we remove the ErrNilDocument and ErrNilValue errors or keep them and wrap them with an InvalidArgumentError?
- is duplicated by
-
GODRIVER-773 Improve context of 'document is nil' errors
- Closed
- related to
-
GODRIVER-2704 Replace all input validation error constants with "InvalidArgumentError"
- Backlog