From b1071bd1725c6c73eb06465e1529eb421aa594cf Mon Sep 17 00:00:00 2001 From: Pranav Bhaskaran <67958542+Pranav-b-7@users.noreply.github.com> Date: Fri, 27 Oct 2023 20:06:30 +0530 Subject: [PATCH] fix(bakery): change exception handling in MonitorBakeTask to use Spinnaker*Exception instead of RetrofitError now that https://github.com/spinnaker/orca/pull/4529 has added SpinnakerRetrofitErrorHandler to BakerySelector (#4576) --- .../spinnaker/orca/bakery/tasks/MonitorBakeTask.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/orca-bakery/src/main/groovy/com/netflix/spinnaker/orca/bakery/tasks/MonitorBakeTask.groovy b/orca-bakery/src/main/groovy/com/netflix/spinnaker/orca/bakery/tasks/MonitorBakeTask.groovy index 07f0b8044b..c68fb7511a 100644 --- a/orca-bakery/src/main/groovy/com/netflix/spinnaker/orca/bakery/tasks/MonitorBakeTask.groovy +++ b/orca-bakery/src/main/groovy/com/netflix/spinnaker/orca/bakery/tasks/MonitorBakeTask.groovy @@ -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 @@ -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 @@ -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