Skip to content

Commit

Permalink
refactor(JenkinsService): add SpinnakerConversionException
Browse files Browse the repository at this point in the history
  • Loading branch information
SheetalAtre committed Sep 19, 2023
1 parent be2968f commit b3c7aaa
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import com.netflix.spinnaker.igor.service.BuildProperties;
import com.netflix.spinnaker.kork.core.RetrySupport;
import com.netflix.spinnaker.kork.exceptions.SpinnakerException;
import com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerConversionException;
import com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerHttpException;
import com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerNetworkException;
import com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerServerException;
Expand All @@ -65,7 +66,6 @@
import org.springframework.web.util.UriUtils;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.SafeConstructor;
import retrofit.RetrofitError;
import retrofit.client.Header;
import retrofit.client.Response;

Expand Down Expand Up @@ -217,16 +217,13 @@ private ScmDetails getGitDetails(String jobName, Integer buildNumber) {
() -> {
try {
return jenkinsClient.getGitDetails(encode(jobName), buildNumber);
} catch (RetrofitError e) {
} catch (SpinnakerConversionException e) {
// assuming that a conversion error is unlikely to succeed on retry
if (e.getKind() == RetrofitError.Kind.CONVERSION) {
log.warn(
"Unable to deserialize git details for build " + buildNumber + " of " + jobName,
e);
return null;
} else {
throw e;
}
log.warn(
"Unable to deserialize git details for build " + buildNumber + " of " + jobName, e);
return null;
} catch (SpinnakerServerException e) {
throw e;
}
},
10,
Expand Down

0 comments on commit b3c7aaa

Please sign in to comment.