Skip to content

Conversation

edarchis
Copy link
Member

@edarchis edarchis commented Nov 9, 2021

No description provided.

So far, we only knew that the call had failed, not why. With this, we'll have the error payload.
@delcroip delcroip requested a review from malinowskikam April 12, 2022 07:39
@delcroip
Copy link
Member

@malinowskikam could you check this one

Copy link
Contributor

@malinowskikam malinowskikam left a comment

Choose a reason for hiding this comment

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

@delcroip The worflow changes look good, but the ToRestApi change has to be removed (comment)

Comment on lines +67 to +74
if (responseCode >= 400) {
Log.e("HTTP_POST", object.toString());
HttpEntity entity = response.getEntity();
if (entity != null) {
String errorPayload = EntityUtils.toString(entity);
Log.e("HTTP_POST", "error payload" + errorPayload);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This code will break any error handling requiring the response content, as it is consumed upon read. I added similar code to the getContent method so it can be logged and used for error handling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants