From 08b7ecd3f1d10b69a724ee4f908faeb9c18604e8 Mon Sep 17 00:00:00 2001 From: Aurora Lahtela <24460436+AuroraLS3@users.noreply.github.com> Date: Mon, 6 Dec 2021 17:14:00 +0200 Subject: [PATCH] Throw different error when given invalid time unit Affects issues: - Close #2193 --- .../plan/settings/config/paths/key/TimeSetting.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plan/common/src/main/java/com/djrapitops/plan/settings/config/paths/key/TimeSetting.java b/Plan/common/src/main/java/com/djrapitops/plan/settings/config/paths/key/TimeSetting.java index 1ca6d940b..4e00a8dc5 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/settings/config/paths/key/TimeSetting.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/settings/config/paths/key/TimeSetting.java @@ -62,7 +62,7 @@ public class TimeSetting extends Setting { TimeUnit unit = TimeUnit.valueOf(unitName.toUpperCase()); return unit.toMillis(duration); } catch (IllegalArgumentException e) { - return -1L; + throw new IllegalStateException("Config value for " + path + ".Unit has a bad value: " + e.getMessage()); } } -} \ No newline at end of file +}