{"record":{"id":"4f9e6d8be46419cf","repo":"jackwener/OpenCLI","slug":"payload-message-huodongxing-events-returned","errorCode":null,"errorMessage":"${payload?.message || 'huodongxing events returned malformed extraction data'}","messagePattern":"\\$\\{payload\\?\\.message \\|\\| 'huodongxing events returned malformed extraction data'\\}","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/huodongxing/events.js","lineNumber":305,"sourceCode":"      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    );\n  }\n  throw new CommandExecutionError(\n    payload?.message || 'huodongxing events returned malformed extraction data',\n    payload?.hint || 'Huodongxing extraction did not return the expected structured payload.',\n  );\n}\n\nexport function extractEventRows(limit = 20) {\n  return requireExtractionRows(extractEventRowsPayload(limit));\n}\n\nasync function extractEventRowsFromPage(page, limit) {\n  return page.evaluate(`(${extractEventRowsPayload.toString()})(${limit})`);\n}\n\nasync function waitForEventCards(page) {\n  await page.wait({ selector: RESULT_CARD_SELECTOR, timeout: 10 }).catch(async () => {\n    await page.wait({ time: 1 });\n  });\n}","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/huodongxing/events.js#L287-L323","documentation":"The fallback in requireExtractionRows: the payload had no recognized code and did not match the ok/rows contract, so extraction returned wholly malformed data. Thrown as CommandExecutionError with the payload's own message/hint when available.","triggerScenarios":"page.evaluate returns null/undefined, an error object, or an unexpected shape (no ok, no known code) — e.g. navigation failed mid-evaluate or the site served an unexpected page.","commonSituations":"Browser navigation interrupted; site layout overhaul breaking the extractor's contract entirely; captive portal or proxy injecting HTML into the evaluate result.","solutions":["Retry the command to rule out transient navigation issues","Verify the site is reachable in a normal browser","Update the CLI/extractor to match current site markup","Log the raw payload to diagnose the unexpected shape"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"const isKnownPayload = p => p && typeof p === 'object' && (p.ok === true || ['RATE_LIMIT','TRANSIENT_ACCESS','INVALID_LIMIT','EMPTY_RESULT'].includes(p.code));","tryCatchPattern":"try { const rows = extractEventRows(limit); } catch (e) { if (e instanceof CommandExecutionError && /malformed extraction data/.test(e.message)) { logRawPayload(e); /* retry or escalate with diagnostics */ } else throw e; }","preventionTips":["Retry once with backoff for transient navigation failures","Keep the extractor and CLI versions in sync","Verify network/proxy stability — injected pages corrupt evaluate results","Log the raw payload included in the error for diagnosis"],"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"}