{"record":{"id":"d6aa06437c91f872","repo":"jackwener/OpenCLI","slug":"rate-limit","errorCode":"RATE_LIMIT","errorMessage":"${payload.message || 'huodongxing events was rate limited by www.huodongxing.com'}","messagePattern":"\\$\\{payload\\.message \\|\\| 'huodongxing events was rate limited by www\\.huodongxing\\.com'\\}","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/huodongxing/events.js","lineNumber":285,"sourceCode":"  }\n  return { ok: true, rows };\n}\n\nfunction isTransientAccessPayload(result) {\n  return unwrapEvaluateResult(result)?.code === 'TRANSIENT_ACCESS';\n}\n\nfunction requireExtractionRows(result) {\n  const payload = unwrapEvaluateResult(result);\n  if (payload?.ok === true && Array.isArray(payload.rows)) return payload.rows;\n  if (payload?.ok === true) {\n    throw new CommandExecutionError(\n      'huodongxing events returned malformed extraction rows',\n      'Expected browser extraction payload rows to be an array.',\n    );\n  }\n  if (payload?.code === 'RATE_LIMIT') {\n    throw new CommandExecutionError(\n      payload.message || 'huodongxing events was rate limited by www.huodongxing.com',\n      payload.hint || 'Wait a few minutes and retry from a real browser session.',\n    );\n  }\n  if (payload?.code === 'TRANSIENT_ACCESS') {\n    throw new CommandExecutionError(\n      payload.message || 'huodongxing events page returned a temporary busy/access page',\n      payload.hint || 'Wait and retry from the same browser session.',\n    );\n  }\n  if (payload?.code === 'INVALID_LIMIT') {\n    throw new ArgumentError(payload.message || 'huodongxing limit must be a positive integer <= 50');\n  }\n  if (payload?.code === 'EMPTY_RESULT') {\n    throw new EmptyResultError(\n      'huodongxing events',\n      payload.hint || 'No Huodongxing event cards were found. The page may be empty.',\n    );","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/huodongxing/events.js#L267-L303","documentation":"The in-page extractor signalled code 'RATE_LIMIT', meaning www.huodongxing.com rate-limited the session. requireExtractionRows converts it into a CommandExecutionError, forwarding the payload's message and hint when present.","triggerScenarios":"Scraping too many events pages in a short window, or reusing an automated session the site has flagged, causing the extraction payload to come back with code: 'RATE_LIMIT'.","commonSituations":"Tight loops over date ranges or pagination; shared IP under heavy load; missing cookies from a real logged-in browsing session.","solutions":["Wait several minutes before retrying","Run from a real browser session with normal cookies (as the hint suggests)","Reduce request frequency / add delays between calls","Change IP or network if the block persists"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { const rows = extractEventRows(limit); } catch (e) { if (e instanceof CommandExecutionError && e.message.includes('rate limited')) { await sleep(minutes(5)); return extractEventRows(limit); } throw e; }","preventionTips":["Throttle requests — add delays between event queries","Scrape from a genuine logged-in browser session, not a bare headless one","Batch date-range queries instead of looping per-day","Back off exponentially when this error appears"],"tags":["rate-limit","scraping","retryable"],"backgroundTag":"http-429-rate-limit","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}