From 3001a4a5420e21567ae601a55667c1cdda4a64ef Mon Sep 17 00:00:00 2001 From: Magnus Ulf Date: Sat, 19 Jan 2019 14:37:29 +0100 Subject: [PATCH] Improve debugging when migration fails --- .../massivecore/store/migrator/MigratorRoot.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/com/massivecraft/massivecore/store/migrator/MigratorRoot.java b/src/com/massivecraft/massivecore/store/migrator/MigratorRoot.java index 95cfea68..c993b2c9 100644 --- a/src/com/massivecraft/massivecore/store/migrator/MigratorRoot.java +++ b/src/com/massivecraft/massivecore/store/migrator/MigratorRoot.java @@ -114,7 +114,18 @@ public class MigratorRoot implements Migrator, Active if (entityVersionCurrent != entityVersionExpected) throw new IllegalArgumentException(String.format("Entiy version: %d Expected: %d", entityVersionCurrent, entityVersionExpected)); // ... do the migration. - this.migrateInner(entity); + + try + { + this.migrateInner(entity); + } + catch (Throwable t) + { + System.out.println("Problem with migrating entity: "); + System.out.println(entity.toString()); + throw t; + } + this.migrateVersion(entity); }