Gets errors if Invalid, null if Valid.
Set<String>? getErrors() => switch (this) { Invalid(:final errors) => errors, Valid() => null, };