textmagic / textmagic-rest-ruby

MIT License
1 stars 4 forks source link

Logging and error messages #76

Open lucaspiller opened 8 years ago

lucaspiller commented 8 years ago

I've been integrating TextMagic into an existing app, and it's been pretty painful because when something goes wrong all I get is Textmagic::REST::RequestError: Validation Failed which isn't helpful.

At the very least, when an error occurs please provide a way to to get the actual response:

I'd also like to see the request and response in my application logs (at least the url requested, response code and timings, but more would be better). Please add a logger and a way to override it - I want to use the Rails logger, but for non-Rails apps I'd like to be able to specify something else.

(I've just noticed that the latest Git version has better error exposing than the release version - please update the version on RubyGems and add a CHANGELOG)