Skip to content

Commit

Permalink
Fixed flyway#2553 More helpful error message
Browse files Browse the repository at this point in the history
  • Loading branch information
juliahayward committed Nov 5, 2019
1 parent 52de5f5 commit fbf641a
Showing 1 changed file with 9 additions and 3 deletions.
Expand Up @@ -63,14 +63,20 @@ public static Pair<MigrationVersion, String> extractVersionAndDescription(String
if (StringUtils.hasText(version)) {
if (repeatable) {
throw new FlywayException("Wrong repeatable migration name format: " + migrationName
+ "(It cannot contain a version and should look like this: "
+ " (It cannot contain a version and should look like this: "
+ prefix + separator + description + suffixes[0] + ")");
}
return Pair.of(MigrationVersion.fromVersion(version), description);
try {
return Pair.of(MigrationVersion.fromVersion(version), description);
} catch (Exception e) {
throw new FlywayException("Wrong versioned migration name format: " + migrationName
+ " (could not recognise version number " + version + ")", e);
}
}

if (!repeatable) {
throw new FlywayException("Wrong versioned migration name format: " + migrationName
+ "(It must contain a version and should look like this: "
+ " (It must contain a version and should look like this: "
+ prefix + "1.2" + separator + description + suffixes[0] + ")");
}
return Pair.of(null, description);
Expand Down

0 comments on commit fbf641a

Please sign in to comment.