This PR is a WIP, not intended to merge yet. Rather it's intended to demonstrate the direction I intend to head in and to seek review and critique before committing to these changes on a larger scale.
Closes #404
Rationales
These new error messages follow an SVO word order, which is likely to be easier to understand. While more verbose, it is also clearer, explaining that the function argument is the thing that is required to be the ${REQUIRED_THING}
In the case of unary functions I opted for brevity, so not "Unary argument must be..." or "The single argument..." etc.
I opted to capitalize type names like Async and Function, even in the plural case like Function and even for types which don't exist in either JavaScript or Crocks like Integer
I also noticed a few regexps in the tests that were underspecified, and corrected them. No big shakes there, really, but why not.
Coverage remained the same at 100.0% when pulling 5ee77220d57b41bce5c75db3b91ddd6672d0f2e1 on error-reword into 7fd28d25c3b7a2822690616de2a178cf3e4de329 on master.
Coverage remained the same at 100.0% when pulling bc71c2e7bd53eb78fc3f11d52858a55f4e094d56 on error-reword into 1ff50f7583212f04cd16c7f267d93f55d84da67b on master.
This PR is a WIP, not intended to merge yet. Rather it's intended to demonstrate the direction I intend to head in and to seek review and critique before committing to these changes on a larger scale.
Closes #404
Rationales
These new error messages follow an SVO word order, which is likely to be easier to understand. While more verbose, it is also clearer, explaining that the function argument is the thing that is required to be the
${REQUIRED_THING}
In the case of unary functions I opted for brevity, so not "Unary argument must be..." or "The single argument..." etc.
I opted to capitalize type names like
Async
andFunction
, even in the plural case likeFunction
and even for types which don't exist in either JavaScript or Crocks likeInteger
I also noticed a few regexps in the tests that were underspecified, and corrected them. No big shakes there, really, but why not.