Not sure I understand the alternative.  I could use a regex instead.  However, since it's a single line error message, it seems cleaner to be more explicit in this case.