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

invokeAPI populate response object in ApiException for non successful… #71

Merged
merged 2 commits into from Apr 21, 2018
Merged

Conversation

psytester
Copy link
Contributor

… HTTP codes

This PR is for the issue #68 request to populate the response in ApiException object for non successful HTTP codes.
With that change the client code can process on it.

… HTTP codes

This PR is for the issue #68 request to populate the response in ApiException object for non successful HTTP codes.
With that change the client code can process on it.
@@ -766,7 +766,13 @@ private ClientResponse getAPIResponse(String path, String method, List<Pair> que
ClientResponse response = getAPIResponse(path, method, queryParams, body, headerParams, formParams, accept, contentType, authNames);

if (response.getStatusInfo().getFamily() != Family.SUCCESSFUL) {
throw new ApiException("Error while requesting server, received HTTP code: " + response.getStatusInfo().getStatusCode() + " / with response Body: " + response.getEntity(String.class));
String respBody = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

@psytester can you change it to: String respBody = response.getEntity(String.class);

Copy link
Contributor

@mmallis87 mmallis87 left a comment

Choose a reason for hiding this comment

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

LGTM!

@mmallis87 mmallis87 merged commit b444b5a into docusign:master Apr 21, 2018
mmallis87 added a commit that referenced this pull request Aug 29, 2019
invokeAPI populate response object in ApiException for non successful…
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.

None yet

2 participants