Skip to content

Commit

Permalink
fix(scm): restore original behavior in GitHubCommitController, fix co…
Browse files Browse the repository at this point in the history
…mpile error in ManagedDeliveryScmController
  • Loading branch information
SheetalAtre committed Sep 15, 2023
1 parent a0f473f commit 289916b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ class CommitController extends AbstractCommitController {
try {
commitsResponse = master.gitHubClient.getCompareCommits(projectKey, repositorySlug, requestParams.to, requestParams.from)
} catch (SpinnakerServerException e) {
if(e instanceof SpinnakerNetworkException) {
if (e instanceof SpinnakerNetworkException) {
throw new NotFoundException("Could not find the server ${master.baseUrl}")
} else if(e instanceof SpinnakerHttpException && ((SpinnakerHttpException)e).getResponseCode() == 404) {
} else if (e instanceof SpinnakerHttpException && ((SpinnakerHttpException)e).getResponseCode() == 404) {
return getNotFoundCommitsResponse(projectKey, repositorySlug, requestParams.to, requestParams.from, master.baseUrl)
}
log.error("Unhandled error response, acting like commit response was not found", e)
}

commitsResponse.commits.each {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class GitHubMaster extends AbstractScmMaster {
.map({ r -> r.path })
.collect(Collectors.toList())
} catch (SpinnakerServerException e) {
if (e instanceof SpinnakerNetworkException) {
if (e instanceof SpinnakerNetworkException) {
throw new NotFoundException("Could not find the server ${baseUrl}")
}
log.error(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ public ResponseEntity<Map<String, Object>> getDeliveryConfigManifest(
status = HttpStatus.BAD_REQUEST;
} else if (e instanceof SpinnakerServerException) {
if (e instanceof SpinnakerHttpException) {
SpinnakerHttpException re = (SpinnakerHttpException) e;
status = HttpStatus.valueOf(re.getResponseCode());
errorDetails = re.getResponseBody();
SpinnakerHttpException spinnakerHttpException = (SpinnakerHttpException) e;
status = HttpStatus.valueOf(spinnakerHttpException.getResponseCode());
errorDetails = spinnakerHttpException.getResponseBody();
} else {
errorDetails = "Error calling downstream system: " + e.getMessage();
}
Expand Down

0 comments on commit 289916b

Please sign in to comment.