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

Fixed #32 issues with error handling #38

Closed
wants to merge 3 commits into from

Conversation

Kanosakl
Copy link

Was having a lot of confusion with this issue myself until I notice that the error reason resides in the body instead of in the response itself. I've added statusBody into the error object itself which allow me to get detailed message on what went wrong.

changes are on line 390 in ApiClient.js

   if (response.statusCode >= 400) {
                  _this.debug('error response', {
                    statusCode: response.statusCode,
                    statusMessage: response.statusMessage
                  });
                  reject({statusCode: response.statusCode, statusMessage: response.statusMessage, statusBody: body});
                }

(PS: my first pull request, sorry in advance if there's any mistake)

@cyrillef
Copy link
Collaborator

I took the changes, but the merge tool was not taking the code change properly. So I reject this PR but submitted the code changes in the master branch. Code change accepted.

@cyrillef cyrillef closed this Feb 13, 2019
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