diff --git a/kayenta-core/src/main/java/com/netflix/kayenta/retrofit/config/RetrofitClientConfiguration.java b/kayenta-core/src/main/java/com/netflix/kayenta/retrofit/config/RetrofitClientConfiguration.java index 809828503..6bfed46a0 100644 --- a/kayenta-core/src/main/java/com/netflix/kayenta/retrofit/config/RetrofitClientConfiguration.java +++ b/kayenta-core/src/main/java/com/netflix/kayenta/retrofit/config/RetrofitClientConfiguration.java @@ -21,6 +21,7 @@ import com.netflix.kayenta.config.KayentaConfiguration; import com.netflix.spinnaker.config.OkHttpClientConfiguration; import com.netflix.spinnaker.orca.retrofit.exceptions.RetrofitExceptionHandler; +import com.netflix.spinnaker.orca.retrofit.exceptions.SpinnakerServerExceptionHandler; import com.squareup.okhttp.ConnectionPool; import com.squareup.okhttp.OkHttpClient; import org.springframework.beans.factory.annotation.Value; @@ -57,6 +58,12 @@ RetrofitExceptionHandler retrofitExceptionHandler() { return new RetrofitExceptionHandler(); } + @Bean + @Order(Ordered.HIGHEST_PRECEDENCE) + SpinnakerServerExceptionHandler spinnakerServerExceptionHandler() { + return new SpinnakerServerExceptionHandler(); + } + @Bean @ConditionalOnMissingBean(ObjectMapper.class) ObjectMapper retrofitObjectMapper() {