Subject: | More user-friendly error message than "parameter not listed in the validation options" |
Running the code my `$date2 = $date1->subtract(day => 1)`, will produce
the error below:
"The following parameter was passed in the call to
DateTime::Duration::new but was not listed in the validation options: day"
Huh?
It actually took me a while to realize the typo ("days" instead of
"day") because the error message hinted at 'DateTime::Duration::new"
being called, which was not readily apparent. Plus, what are the
"validation options"? Couldn't find anything about that on (anno)CPAN.
Would be nicer to get an error message like:
'day' is not a valid parameter for ->subtract