Throw different error when given invalid time unit

Affects issues:
- Close #2193
This commit is contained in:
Aurora Lahtela 2021-12-06 17:14:00 +02:00 committed by GitHub
parent 3e9eda29fb
commit 08b7ecd3f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,7 +62,7 @@ public class TimeSetting extends Setting<Long> {
TimeUnit unit = TimeUnit.valueOf(unitName.toUpperCase()); TimeUnit unit = TimeUnit.valueOf(unitName.toUpperCase());
return unit.toMillis(duration); return unit.toMillis(duration);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
return -1L; throw new IllegalStateException("Config value for " + path + ".Unit has a bad value: " + e.getMessage());
} }
} }
} }