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
3bfac44
to
2dcf5c0
Compare
igor-monitor-travis/src/main/java/com/netflix/spinnaker/igor/travis/service/TravisService.java
Outdated
Show resolved
Hide resolved
f15a3be
to
5a9efc6
Compare
7a71112
to
aa4f0bc
Compare
igor-monitor-travis/src/main/java/com/netflix/spinnaker/igor/travis/service/TravisService.java
Outdated
Show resolved
Hide resolved
igor-monitor-travis/src/main/java/com/netflix/spinnaker/igor/travis/service/TravisService.java
Outdated
Show resolved
Hide resolved
…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
f88bf13
to
9f17d8b
Compare
} 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 |
There was a problem hiding this comment.
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.
To make use of custom spinnaker exception instead of RetrofitError using SpinnakerRetrofitErrorHandler present in kork service, to rectify dependency of RetrofitError class