Improve debugging when migration fails

This commit is contained in:
Magnus Ulf 2019-01-19 14:37:29 +01:00
parent 2effee0f5c
commit 3001a4a542

View File

@ -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)); if (entityVersionCurrent != entityVersionExpected) throw new IllegalArgumentException(String.format("Entiy version: %d Expected: %d", entityVersionCurrent, entityVersionExpected));
// ... do the migration. // ... 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); this.migrateVersion(entity);
} }