Handle HTTP request errors.