adunkman/node-trello — pull request #14 by matcarey (2014-07-21 21:16:22+00:00)
Title: Providing error on all HTTP error status codes.

Based on https://github.com/adunkman/node-trello/pull/12

When the API returns an error (anything in HTTP 4xx and 5xx range) it's passed back to the user as an error.

An example is

````javascript
var Trello = require("node-trello");
var t = new Trello("intentionally-wrong", "intentionally-wrong");

t.get("/1/boards/intentionally-wrong/cards", function (err, data) {
if (err) {
console.log('status:', err.statusCode);
console.log('message:', err.statusMessage);
console.log('body:', err.responseBody);
throw err;
}
console.log('success', data);
});
````

The output is

````bash
status: 401
message: Unauthorized
body: invalid key

Error: invalid key
````