{"record":{"id":"a452984768d65406","repo":"jackwener/OpenCLI","slug":"huodongxing-events-returned-malformed-extraction-r","errorCode":null,"errorMessage":"huodongxing events returned malformed extraction rows","messagePattern":"huodongxing events returned malformed extraction rows","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/huodongxing/events.js","lineNumber":279,"sourceCode":"    return {\n      ok: false,\n      code: 'EMPTY_RESULT',\n      message: 'huodongxing events returned no data',\n      hint: 'No Huodongxing event cards were found. The page may be empty or the DOM structure may have changed.',\n    };\n  }\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');","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/huodongxing/events.js#L261-L297","documentation":"After the browser extracts event cards, requireExtractionRows expects payload { ok: true, rows: [...] }. If ok is true but rows is missing or not an array, the in-page extractor returned an unexpected shape, so this CommandExecutionError is thrown.","triggerScenarios":"The page.evaluate extraction script returns { ok: true } without an array rows field — typically after a site DOM/markup change or a partially failed in-page script branch.","commonSituations":"huodongxing changed its event-card markup so the extractor returns no rows array; stale CLI version incompatible with the current site layout; anti-bot page partially satisfied the probe.","solutions":["Update the CLI to the latest version that matches the current huodongxing markup","Retry the command; a transient page state may have produced the bad payload","Inspect the browser session manually to confirm the events page renders normally","If persistent, file/patch the extractor script so it always returns rows as an array"],"exampleFix":"// inside the page script\n// before\nreturn { ok: true, rows: extractCards() };\n// after\nconst rows = extractCards();\nreturn { ok: true, rows: Array.isArray(rows) ? rows : [] };","handlingStrategy":"retry","validationCode":null,"typeGuard":"const isExtractionPayload = p => p && typeof p === 'object' && p.ok === true && Array.isArray(p.rows);","tryCatchPattern":"try { const rows = extractEventRows(limit); } catch (e) { if (e instanceof CommandExecutionError && /malformed extraction rows/.test(e.message)) { /* retry once after a short delay; else report CLI/site mismatch */ } else throw e; }","preventionTips":["Keep the CLI updated against huodongxing markup changes","Retry transient extraction failures once with backoff","Monitor for repeated occurrences — they signal a DOM/selector regression, not user error"],"tags":["runtime","scraping","malformed-payload"],"backgroundTag":"malformed-scrape-payload","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}