pub async fn handle_response_error(response: Response) -> Result<Response>
Helper function to handle HTTP response errors