IMO in this case it'd be better to just try looping over the parameter and catching the exception if it fails.