Skip to content

Commit

Permalink
refactor(echo): use SpinnakerRetrofitErrorHandler with EchoService (#…
Browse files Browse the repository at this point in the history
…4670)

This code change is to maintain the uniformity across all the retrofit client configurations in ORCA,  as part of upgrading the retrofit version to 2.x.

There are neither any changes to the exception handler logics nor any behaviour changes involved.
  • Loading branch information
Pranav-b-7 authored Mar 11, 2024
1 parent 19082b4 commit 5f0f94b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions orca-echo/orca-echo.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ dependencies {
implementation("javax.validation:validation-api")
implementation("io.spinnaker.fiat:fiat-core:$fiatVersion")
implementation("io.spinnaker.fiat:fiat-api:$fiatVersion")
implementation("io.spinnaker.kork:kork-retrofit")

testImplementation("com.squareup.retrofit:retrofit-mock")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import com.jakewharton.retrofit.Ok3Client
import com.netflix.spinnaker.config.DefaultServiceEndpoint
import com.netflix.spinnaker.config.okhttp3.OkHttpClientProvider
import com.netflix.spinnaker.kork.dynamicconfig.DynamicConfigService
import com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerRetrofitErrorHandler
import com.netflix.spinnaker.orca.echo.EchoService
import com.netflix.spinnaker.orca.echo.spring.EchoNotifyingExecutionListener
import com.netflix.spinnaker.orca.echo.spring.EchoNotifyingStageListener
Expand Down Expand Up @@ -69,6 +70,7 @@ class EchoConfiguration {
.setEndpoint(echoEndpoint)
.setClient(new Ok3Client(clientProvider.getClient(new DefaultServiceEndpoint("echo", echoEndpoint.url))))
.setLogLevel(retrofitLogLevel)
.setErrorHandler(SpinnakerRetrofitErrorHandler.getInstance())
.setLog(new RetrofitSlf4jLog(EchoService))
.setConverter(new JacksonConverter())
.build()
Expand Down

0 comments on commit 5f0f94b

Please sign in to comment.