resolveErrorMessage method
Resolves the message to report for a failed validation.
Returns errorMessage when it has been set, otherwise defaultMessage.
Subclasses with a single failure mode should use this to honor a
caller-supplied override while keeping their existing default message.
Implementation
String resolveErrorMessage(String defaultMessage) =>
errorMessage ?? defaultMessage;