From 68ec5e48cb73aeb930be1958e1468677b19cb267 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 1 Dec 2018 21:25:58 -0800 Subject: [PATCH] Added helpful message for API authors Helps debug issue for missing database object default constructors. --- src/main/java/world/bentobox/bentobox/database/Database.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/bentobox/database/Database.java b/src/main/java/world/bentobox/bentobox/database/Database.java index f10ab3a9d..35f4d8d33 100644 --- a/src/main/java/world/bentobox/bentobox/database/Database.java +++ b/src/main/java/world/bentobox/bentobox/database/Database.java @@ -66,8 +66,11 @@ public class Database { try { result = handler.loadObject(uniqueId); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException - | ClassNotFoundException | IntrospectionException | NoSuchMethodException | SecurityException e) { + | ClassNotFoundException | IntrospectionException | SecurityException e) { logger.severe(() -> "Could not load object from database! " + e.getMessage()); + } catch (NoSuchMethodException e) { + logger.severe(() -> "Could not load object from database! " + e.getMessage()); + logger.severe(() -> "Did you forget the JavaBean no-arg default constructor?"); } return result; }