RevisionDateProvider error message improved
@@ -27,9 +27,15 @@ class RevisionDateProvider {
public Date getDate(String rev) {
String gitOutput = runner.run("git", "log", "--pretty=%ad", "--date=iso", rev, "-n", "1");
if(!REVISION_DATE_PATTERN.matcher(gitOutput).matches()){
- throw new IllegalArgumentException("Can't get a proper date for revision number " + rev + ". Are you sure this revision or tag exists?");
+ throw new IllegalArgumentException(formatErrorMessage(rev, gitOutput));
}
return parseDate(gitOutput.trim());
}
+
+ private String formatErrorMessage(String rev, String gitOutput) {
+ return "Can't get a proper date for revision number " + rev +
+ ". Are you sure this revision or tag exists?" +
+ " Following output was returned by git:\n" + gitOutput;
+ }
}
