generic: catch the error code from get_http_data