Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(travisclient): make changes to travisClient to use Spinnaker custom exception instead of RetrofitError using SpinnakerRetrofitErrorHandler #1090

Conversation

Luthan95
Copy link
Contributor

To make use of custom spinnaker exception instead of RetrofitError using SpinnakerRetrofitErrorHandler present in kork service, to rectify dependency of RetrofitError class

@Luthan95 Luthan95 force-pushed the travis_client_user_exception_handling_for_retrofiterror branch 2 times, most recently from 3bfac44 to 2dcf5c0 Compare March 24, 2023 11:57
@Luthan95 Luthan95 force-pushed the travis_client_user_exception_handling_for_retrofiterror branch 2 times, most recently from f15a3be to 5a9efc6 Compare May 8, 2023 11:31
@SheetalAtre SheetalAtre force-pushed the travis_client_user_exception_handling_for_retrofiterror branch 4 times, most recently from 7a71112 to aa4f0bc Compare August 29, 2023 13:36
Luthan95 and others added 2 commits September 12, 2023 15:32
…rofitErrorHandler for custom error handling in travis client
 refactor(travisService/test):  response body could be null for eg when a json converter is unable to convert non-json format
@SheetalAtre SheetalAtre force-pushed the travis_client_user_exception_handling_for_retrofiterror branch from f88bf13 to 9f17d8b Compare September 12, 2023 10:05
} catch (RuntimeException ex) {
log.warn("{}: Could not parse original error message from Travis", groupKey, ex);
} catch (SpinnakerServerException e) {
if (e instanceof SpinnakerHttpException) { // only SpinnakerHttpException has a response body
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you've got here matches the current behavior, but...I'm tempted to clean up this code and change the behavior all at the same time.

If I'm reading the code correctly, the current behavior swallows an RetrofitError that has a null body. That seems a little unfortunate.

If we change this to catch SpinnakerHttpException instead of SpinnakerServerException, we let the other exception types bubble up. That feels like better behavior. But, this PR has lived a long time, and I don't have a good way to exercise this specific functionality so let's leave this for another time.

@dbyron-sf dbyron-sf marked this pull request as ready for review September 14, 2023 22:38
@dbyron-sf dbyron-sf added the ready to merge Approved and ready for merge label Sep 14, 2023
@mergify mergify bot added the auto merged label Sep 14, 2023
@mergify mergify bot merged commit 1c88412 into spinnaker:master Sep 14, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants