gate icon indicating copy to clipboard operation
gate copied to clipboard

fix(core): fix the issues caused due to the use of SpinnakerRetrofitErrorHandler in building FiatService

Open kirangodishala opened this issue 4 months ago • 0 comments

https://github.com/spinnaker/fiat/pull/1034 changed FiatService bean in fiat-api to use SpinnakerRetrofitErrorHandler. This broke some of the gate code as the RetrofitError catch blocks are no longer valid.

This PR replaces RetrofitError with SpinnakerServerException and its sub classes appropriately. In the process, I converted PermissionServiceSpec groovy test class to PermissionServiceTest.java.

With the conversion from RetrofitError to Spinnaker*Exception there is a slight change in behaviour:

  • Unexpected error used to be retryable but now it's not. Because we don't have a SpinnakerUnexpectedException classification. So any SpinnakerServerException is not retryable by default.
  • There is no equivalent Retrofit's Conversion error with response code. In other words, SpinnakerConversionException doesn't have mechanism to get response code. Hence earlier conversionError(500) was retryable but it's not longer the case. All SpinnakerConversionException types are non-retryable.

kirangodishala avatar Oct 10 '24 12:10 kirangodishala