Raise MaxRetryError if server returns an error response.