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() --> ApiException() if non HTTP 200 #59

Merged
merged 3 commits into from Mar 20, 2018
Merged

invokeAPI() --> ApiException() if non HTTP 200 #59

merged 3 commits into from Mar 20, 2018

Conversation

psytester
Copy link
Contributor

There was no error indication in case the restapi request gets back a non HTTP 200 code, e.g. HTTP 400 / 401 / 403 / ....

There was no error indication in case the restapi request gets back a non HTTP 200 code, e.g. HTTP 400 / 401 / 403 / ....
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.

@psytester DocuSign API POST can return 201. I don't think it's a good idea to raise exceptions based on the HTTP response code.

I changed the the check against Family.SUCCESSFUL to catch all 2xx HTTP codes, the 201 Created, too.
According to DocuSign API it should be sufficient to detect successful cases.

Why I throw this exception to indicate a bad server response:
If we exit the method at line 757 or 760 with "return null;" we can not react on upper level in our application side based on HTTP code.
No indication is possible what's going wrong in that api call.

If this is not what you asked, please give me a hint ;-)
@psytester
Copy link
Contributor Author

@mmallis87
I changed the check against Family.SUCCESSFUL to catch all 2xx HTTP codes, the 201 Created, too.
According to DocuSign API it should be sufficient to detect successful cases.
If this is not what you asked, please give me a hint ;-)

Why I throw this exception to indicate a bad server response:
If we exit the method at line 757 or 760 with "return null;" we can not react on upper level in our application side based on HTTP code.
No indication is possible what's going wrong in that api call.

Just in case the last change for non HTTP 2xx handling will be rejected once more and not to loose the latest changes, I added the setReadTimeout code from PR62
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.

Family.SUCCESSFUL is the right thing to use 👍

@mmallis87 mmallis87 merged commit 33759c1 into docusign:master Mar 20, 2018
@psytester psytester deleted the patch-3 branch March 23, 2018 20:16
mmallis87 added a commit that referenced this pull request Aug 29, 2019
invokeAPI() --> ApiException() if non HTTP 200
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