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

feat(retrofit): add accessor to exception response body as a map #1074

Merged

Conversation

SheetalAtre
Copy link
Contributor

@SheetalAtre SheetalAtre commented Jul 6, 2023

feat(retrofit): add accessor to exception response body as a map

@SheetalAtre SheetalAtre force-pushed the retrofitException_getBodyAs_map branch from a2856c1 to 20d2bef Compare July 7, 2023 10:24
@dbyron-sf dbyron-sf changed the title refactor(retrofit): store the RetrofitException response error body as hashmap feat(retrofit): add accessor to exception response body as a map to get more details from it Jul 7, 2023
@dbyron-sf dbyron-sf changed the title feat(retrofit): add accessor to exception response body as a map to get more details from it feat(retrofit): add accessor to exception response body as a map Jul 7, 2023
RetrofitErrorResponseBody body =
(RetrofitErrorResponseBody) e.getBodyAs(RetrofitErrorResponseBody.class);
responseBody = (Map<String, Object>) e.getBodyAs(HashMap.class);

this.rawMessage =
Copy link
Contributor

Choose a reason for hiding this comment

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

I have a feeling we'll end up initializing rawMessage something like this

this.rawMessage = e.getMessage();

when we start handling e.g. non-json response bodies. It's possible that would simplify the code here even before that. I'm OK to leave this as it is for now....especially if there's a way to make rawMessage totally disappear.

@SheetalAtre SheetalAtre force-pushed the retrofitException_getBodyAs_map branch from 9b40cd5 to 5ea7274 Compare July 11, 2023 04:07
@SheetalAtre SheetalAtre marked this pull request as ready for review July 11, 2023 04:09
@SheetalAtre SheetalAtre force-pushed the retrofitException_getBodyAs_map branch from 5ea7274 to ee3c63d Compare July 12, 2023 04:08
@SheetalAtre SheetalAtre force-pushed the retrofitException_getBodyAs_map branch from ee3c63d to 14d16fc Compare July 12, 2023 06:00
@dbyron-sf dbyron-sf added the ready to merge Approved and ready for merge label Jul 12, 2023
@mergify mergify bot added the auto merged label Jul 12, 2023
@mergify mergify bot merged commit 221b939 into spinnaker:master Jul 12, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants