Closed mulias closed 6 years ago
Avoid including a stringified value in the error message, since it usually just repeats information already present in the input. In the worst case these bad errors can look like
{ input: [{some: 1, ...}, {big: 2, ...}, {objects: 3, ...}, ...], at: "input", message: "expected a string, got [{some: 1, ...}, {big: 2, ...}, {objects: 3, ...}, ...]" }
Since the full input is already provided, the signal to noise ratio is improved by changing the above error to
{ input: [{some: 1, ...}, {big: 2, ...}, {objects: 3, ...}, ...], at: "input", message: "expected a string, got an array" }
Avoid including a stringified value in the error message, since it usually just repeats information already present in the input. In the worst case these bad errors can look like
Since the full input is already provided, the signal to noise ratio is improved by changing the above error to