better error handling

This commit is contained in:
rusefillc 2021-11-18 00:04:19 -05:00
parent 29469f02d0
commit 4e78a7f2d6
1 changed files with 6 additions and 1 deletions

View File

@ -263,7 +263,12 @@ public class ConfigField {
if (!hasAutoscale) {
return null;
}
if (tsInfo == null)
throw new IllegalArgumentException("tsInfo expected with autoscale");
String[] tokens = tsInfo.split("\\,");
if (tokens.length < 2)
throw new IllegalArgumentException("Second comma-separated token expected in [" + tsInfo + "] for " + name);
String scale = tokens[1].trim();
double factor;
if (scale.startsWith("{") && scale.endsWith("}")) {
@ -289,7 +294,7 @@ public class ConfigField {
// Don't want to deal with exception propogation; this should adequately not compile
return "$*@#$* Cannot accurately represent autoscale for " + tokens[1];
}
return mul + ", " + div;
}