Skip to content

Commit

Permalink
refactor(front50): change RetrofitError to SpinnakerHttpException
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Timpson committed Aug 21, 2024
1 parent d76832b commit bbf9916
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import static java.net.HttpURLConnection.HTTP_NOT_FOUND;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerHttpException;
import com.netflix.spinnaker.orca.api.pipeline.RetryableTask;
import com.netflix.spinnaker.orca.api.pipeline.TaskResult;
import com.netflix.spinnaker.orca.api.pipeline.models.ExecutionStatus;
Expand All @@ -34,7 +35,6 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
import retrofit.RetrofitError;
import retrofit.client.Response;

@Component
Expand Down Expand Up @@ -197,9 +197,9 @@ private Map<String, Object> fetchExistingPipeline(Map<String, Object> newPipelin
if (StringUtils.isNotEmpty(newPipelineID)) {
try {
return front50Service.getPipeline(newPipelineID);
} catch (RetrofitError e) {
} catch (SpinnakerHttpException e) {
// Return a null if pipeline with expected id not found
if (e.getResponse() != null && e.getResponse().getStatus() == HTTP_NOT_FOUND) {
if (e.getResponseCode() == HTTP_NOT_FOUND) {
log.debug("Existing pipeline with id {} not found. Returning null.", newPipelineID);
}
}
Expand Down

0 comments on commit bbf9916

Please sign in to comment.