Better error message.

This commit is contained in:
Michael Lipp 2023-08-08 13:05:56 +02:00
parent 758412673e
commit d74ec52441

View file

@ -124,7 +124,8 @@ public class Configuration implements Dto {
if (matcher.group(3) != null) { if (matcher.group(3) != null) {
unit = unitMap.get(matcher.group(3)); unit = unitMap.get(matcher.group(3));
if (unit == null) { if (unit == null) {
throw new NumberFormatException(amount.toString()); throw new NumberFormatException("Illegal unit \""
+ matcher.group(3) + "\" in \"" + amount.toString() + "\"");
} }
} }
var number = matcher.group(1); var number = matcher.group(1);