mirror of
https://github.com/lightbend/config.git
synced 2025-01-15 23:01:05 +08:00
Throw BugOrBroken if a ValidationFailed is created with no problems
Reported by Max in blog comments, thanks.
This commit is contained in:
parent
516b38f44a
commit
c5028bca3d
@ -339,6 +339,9 @@ public abstract class ConfigException extends RuntimeException {
|
||||
sb.append(p.problem());
|
||||
sb.append(", ");
|
||||
}
|
||||
if (sb.length() == 0)
|
||||
throw new ConfigException.BugOrBroken(
|
||||
"ValidationFailed must have a non-empty list of problems");
|
||||
sb.setLength(sb.length() - 2); // chop comma and space
|
||||
|
||||
return sb.toString();
|
||||
|
Loading…
Reference in New Issue
Block a user