I found that when start and end dates are both in wrong class, the message will only mention the start - can we have error messages mention both are in wrong class?
In the functions age_calculate and dob_from_chi (and possibly some others) there is a check near the top which makes sure that the submitted parameters are the correct class/type.
Some parameters are intuitively paired (e.g. min_date and max_date in dob_from_chi). It would be good if the error message could check both of them and then report if either or both of them are the wrong class. Currently it checks one then if that is the wrong class it will error and report that, not checking the second one.
_Originally posted by @Tina815 in https://github.com/Public-Health-Scotland/phsmethods/pull/85#discussion_r968554013_
In the functions
age_calculate
anddob_from_chi
(and possibly some others) there is a check near the top which makes sure that the submitted parameters are the correct class/type.Some parameters are intuitively paired (e.g.
min_date
andmax_date
indob_from_chi
). It would be good if the error message could check both of them and then report if either or both of them are the wrong class. Currently it checks one then if that is the wrong class it will error and report that, not checking the second one.