keenlabs/KeenClient-Node — pull request #4 by lvivier (2013-12-03 21:25:34+00:00)
Title: Handle superagent errors and expose api error messages

ref #3

This changes the way superagent errors are handled in the client. [Per the docs](http://visionmedia.github.io/superagent/#error-handling), superagent emits `error` events if a request callback only takes one argument. To avoid these errors being thrown, we can just hand them to the callback.

I also changed the way API errors are constructed, to expose the (very nice and helpful) error messages as well as the code.