From 9a37ed70e3d62e5f87e00610df7384476dbdafd6 Mon Sep 17 00:00:00 2001 From: Indyuce Date: Sat, 15 Aug 2020 13:19:14 +0200 Subject: [PATCH] !Slightly improved loading error messages --- .../java/net/Indyuce/mmocore/manager/MMOLoadManager.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/Indyuce/mmocore/manager/MMOLoadManager.java b/src/main/java/net/Indyuce/mmocore/manager/MMOLoadManager.java index 0cb49052..c4e2b8c1 100644 --- a/src/main/java/net/Indyuce/mmocore/manager/MMOLoadManager.java +++ b/src/main/java/net/Indyuce/mmocore/manager/MMOLoadManager.java @@ -59,8 +59,7 @@ public class MMOLoadManager { private T load(Class c, MMOLineConfig config, Function func) { - for (MMOLoader loader : loaders) { - + for (MMOLoader loader : loaders) try { T found = func.apply(loader); if (found != null) @@ -68,8 +67,7 @@ public class MMOLoadManager { } catch (IllegalArgumentException | JsonParseException | IndexOutOfBoundsException exception) { throw new IllegalArgumentException(exception.getMessage()); } - } - throw new IllegalArgumentException("Could not find corresponding " + c.getSimpleName() + " in database"); + throw new IllegalArgumentException("Could not match any " + c.getSimpleName() + " to '" + config.getKey() + "' in database"); } }