better http error handling
fix test
Merge pull request #39 from nchaulet/feature-httperror

better http error handling