refactor(http client): improve request error handling

Abstract response handling and set the response message as the error
message when applicable.