Error handling
get error from body
Merge pull request #2 from JPMoresmau/master

Error handling