Simplify HTTP error handling

All of the error handlers return the same data structure. The other difference between them is the content, all of which is containing in the error object. This allows for all of the errors to be handled by the same function.