-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Properly handling status codes / errors? #39
Comments
@charliecode |
Wondering what I can do to help make some progress with this. I'm looking through your code now trying to figure out where and how I can return status codes. Any pointing in the right direction is greatly appreciated, thanks so much for this awesome library, it's helped me out a ton. |
I just tested this on my system and it successfully sent back the statusCode in an error response. Not sure if anything else should be done to handle this correctly but here it is for what it's worth. In AmazonMwsResource.js in the processResponseType() you can add the following below line # 185, "items.ErrorResponse.Error.statusCode = res.statusCode;". For me this successfully sends back Amazon's res statusCode, I believe. |
Actually this would work better. In AmazonMwsResource.js in the processResponseType() you can add the following below line # 185, if (items.ErrorResponse) { |
Actually again lol, maybe it's better to add "errorResponse.statusCode = res.statusCode;" below line 236. |
@charliecode |
@bhushankumarl |
@bhushankumarl Have you had a chance to load this change live to NPM? I would really like to add this functionality to my project, thanks so much for you help with this. This project is awesome! |
What is the best way to handle status codes / errors?
I don't see anything in the docs about errors. I'm most interested in 500 status codes coming from MWS servers so I know I can retry. The problem is I cannot replicate a 500 status code from MWS. I'm also not sure how you're handling 500 status codes. The only place I've been able to find the status codes MWS returns is when a successful "response" is sent back in the "lastResponse.statusCode. When an "error" is sent back it's missing the status code. The only thing available for the "error" is the "code" which can be different depending on the API your calling. Does the "code" sent back in the "error" always correspond to the api doc error handling? Is there a better way for me to search for status codes rather than code messages? Does a 500 status code return an "error" or a "response"? Thanks so much for your help!
The text was updated successfully, but these errors were encountered: