use of org.flywaydb.core.api.exception.FlywayValidateException in project sparrow by sparrowwallet.
the class DbPersistence method migrate.
private void migrate(Storage storage, String schema, ECKey encryptionKey) throws StorageException {
File migrationDir = getMigrationDir();
try {
Flyway flyway = getFlyway(storage, schema, getFilePassword(encryptionKey), migrationDir);
flyway.migrate();
} catch (FlywayValidateException e) {
log.error("Failed to open wallet file. Validation error during schema migration.", e);
throw new StorageException("Failed to open wallet file. Validation error during schema migration.", e);
} catch (FlywayException e) {
log.error("Failed to open wallet file. ", e);
throw new StorageException("Failed to open wallet file.\n" + e.getMessage(), e);
} finally {
IOUtils.deleteDirectory(migrationDir);
}
}
Aggregations