Catching all sagan exceptions
This commit is contained in:
@@ -64,22 +64,27 @@ public class SaganUpdater {
|
||||
originalVersion, currentVersion, projects);
|
||||
if (updateReleaseException == null) {
|
||||
log.info("Updating Sagan releases with \n\n{}", update);
|
||||
Project project = this.saganClient.updateRelease(currentVersion.projectName,
|
||||
Collections.singletonList(update));
|
||||
Optional<ProjectVersion> projectVersion = latestVersion(currentVersion,
|
||||
project);
|
||||
log.info("Found the following latest project version [{}]", projectVersion);
|
||||
boolean present = projectVersion.isPresent();
|
||||
if (present && currentVersionNewerOrEqual(currentVersion, projectVersion)) {
|
||||
updateDocumentationIfNecessary(projectFile, project);
|
||||
}
|
||||
else {
|
||||
log.info(present
|
||||
? "Latest version [" + projectVersion.get() + "] present and "
|
||||
+ "the current version [" + currentVersion
|
||||
+ "] is older than that one. " + "Will do nothing."
|
||||
: "No latest version found. Will do nothing.");
|
||||
return ExecutionResult.skipped();
|
||||
try {
|
||||
Project project = this.saganClient.updateRelease(currentVersion.projectName,
|
||||
Collections.singletonList(update));
|
||||
Optional<ProjectVersion> projectVersion = latestVersion(currentVersion,
|
||||
project);
|
||||
log.info("Found the following latest project version [{}]", projectVersion);
|
||||
boolean present = projectVersion.isPresent();
|
||||
if (present && currentVersionNewerOrEqual(currentVersion, projectVersion)) {
|
||||
updateDocumentationIfNecessary(projectFile, project);
|
||||
}
|
||||
else {
|
||||
log.info(present
|
||||
? "Latest version [" + projectVersion.get() + "] present and "
|
||||
+ "the current version [" + currentVersion
|
||||
+ "] is older than that one. " + "Will do nothing."
|
||||
: "No latest version found. Will do nothing.");
|
||||
return ExecutionResult.skipped();
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
log.warn("Exception occurred while trying to update sagan release", ex);
|
||||
updateReleaseException = ex;
|
||||
}
|
||||
}
|
||||
return updateReleaseException == null ? ExecutionResult.success()
|
||||
|
||||
@@ -75,7 +75,6 @@ public class ExecutionResult implements Serializable {
|
||||
return new RuntimeException(
|
||||
"[Breaking self reference chain] " + cause.toString());
|
||||
}
|
||||
System.out.println("Not breaking the reference chain. . . i think");
|
||||
return cause;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user