mirkokiefer / aws-lib

Extensible Node.js library for the Amazon Web Services API
MIT License
681 stars 166 forks source link

Report errors back #42

Open manishtpatel opened 12 years ago

manishtpatel commented 12 years ago

ses.call('SendEmail', send_args, function(err, result) { console.log(result); });

Consider above code, when SendEmail request is sent to aws, aws either responds with error or success. But aws-lib does not report error as err, it just returns result back.

Right now everyone i thik parse the result to figure out what happened. But correct way to find result type is using http response code.

We need to use http error code, if code is >= 400 or <600, it should return it as err.

Link to api for easy access http://docs.amazonwebservices.com/ses/latest/APIReference/API_SendRawEmail.html

ndabas commented 12 years ago

I agree - the HTTP status code should be used to determine error status. The issue is here.

With SES, the error is returned in the result as Error instead of Errors.

willwhite commented 11 years ago

See #73.