Skip to content

Commit

Permalink
fix(bakery): change exception handling in MonitorBakeTask to use Spin…
Browse files Browse the repository at this point in the history
…naker*Exception instead of RetrofitError now that #4529 has added SpinnakerRetrofitErrorHandler to BakerySelector (#4576)
  • Loading branch information
Pranav-b-7 authored Oct 27, 2023
1 parent 342dcc6 commit b1071bd
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.netflix.spinnaker.orca.bakery.tasks

import com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerHttpException
import com.netflix.spinnaker.orca.api.pipeline.models.ExecutionStatus
import com.netflix.spinnaker.orca.api.pipeline.OverridableTimeoutRetryableTask
import com.netflix.spinnaker.orca.api.pipeline.models.StageExecution
Expand All @@ -27,7 +28,6 @@ import groovy.util.logging.Slf4j
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.beans.factory.annotation.Value
import org.springframework.stereotype.Component
import retrofit.RetrofitError

@Slf4j
@Component
Expand Down Expand Up @@ -65,9 +65,9 @@ class MonitorBakeTask implements OverridableTimeoutRetryableTask {
}

TaskResult.builder(mapStatus(newStatus)).context([status: newStatus]).build()
} catch (RetrofitError e) {
} catch (SpinnakerHttpException e) {
log.error("Monitor Error {}", e.getMessage())
if (e.response?.status == 404) {
if (e.responseCode == 404) {
return TaskResult.ofStatus(ExecutionStatus.RUNNING)
}
throw e
Expand Down

0 comments on commit b1071bd

Please sign in to comment.