jimrubenstein / node-mandrill

A node.js wrapper for MailChimp's Mandrill API.
MIT License
133 stars 19 forks source link

Perhaps should return an error if status field in response is invalid or rejected? #2

Open cjroebuck opened 12 years ago

cjroebuck commented 12 years ago

If you try sending a mail to an invalid email address for example, mandrill will return the following response:

[{"email":"notavalidemailaddress", "status":"invalid"}] but with status code 200, so node-mandrill thinks its ok, but maybe should return an error in the callback?

jimrubenstein commented 12 years ago

I'd agree with that. In theory, the REST API should return an error status code for that error, since it wasn't a successful request. Obviously this isn't the case, or there's a bug with the response parsing.

Either way, I'll look into what we can do to fix it.