Skip to content

Commit

Permalink
refactor(kayenta): use SpinnakerRetrofitErrorHandler with KayentaServ…
Browse files Browse the repository at this point in the history
…ice (#4678)

As part of the upgradation process of retrofit version to 2.x, this PR aims at ensuring the uniformity across all the retrofit client configurations.

Since the use of RetrofitError are not detected, no changes in the exception handler and no behaviour changes as well.
  • Loading branch information
Pranav-b-7 authored and abe garcia committed Mar 15, 2024
1 parent f81cb29 commit 3fb2627
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions orca-kayenta/orca-kayenta.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dependencies {
implementation("com.netflix.frigga:frigga")
implementation("io.spinnaker.kork:kork-moniker")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("io.spinnaker.kork:kork-retrofit")

testImplementation(project(":orca-test-kotlin"))
testImplementation("com.github.tomakehurst:wiremock-jre8-standalone")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package com.netflix.spinnaker.orca.kayenta.config

import com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS
import com.netflix.spinnaker.kork.api.expressions.ExpressionFunctionProvider
import com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerRetrofitErrorHandler
import com.netflix.spinnaker.orca.jackson.OrcaObjectMapper
import com.netflix.spinnaker.orca.kayenta.KayentaService
import com.netflix.spinnaker.orca.retrofit.RetrofitConfiguration
Expand Down Expand Up @@ -77,6 +78,7 @@ class KayentaConfiguration {
.setLogLevel(retrofitLogLevel)
.setLog(RetrofitSlf4jLog(KayentaService::class.java))
.setConverter(JacksonConverter(mapper))
.setErrorHandler(SpinnakerRetrofitErrorHandler.getInstance())
.build()
.create(KayentaService::class.java)
}
Expand Down

0 comments on commit 3fb2627

Please sign in to comment.