jackwener/OpenCLI · error · CommandExecutionError

${payload?.message || 'huodongxing events returned malformed

Error message

${payload?.message || 'huodongxing events returned malformed extraction data'}

What it means

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.

Source

Thrown at clis/huodongxing/events.js:305

      payload.hint || 'Wait a few minutes and retry from a real browser session.',
    );
  }
  if (payload?.code === 'TRANSIENT_ACCESS') {
    throw new CommandExecutionError(
      payload.message || 'huodongxing events page returned a temporary busy/access page',
      payload.hint || 'Wait and retry from the same browser session.',
    );
  }
  if (payload?.code === 'INVALID_LIMIT') {
    throw new ArgumentError(payload.message || 'huodongxing limit must be a positive integer <= 50');
  }
  if (payload?.code === 'EMPTY_RESULT') {
    throw new EmptyResultError(
      'huodongxing events',
      payload.hint || 'No Huodongxing event cards were found. The page may be empty.',
    );
  }
  throw new CommandExecutionError(
    payload?.message || 'huodongxing events returned malformed extraction data',
    payload?.hint || 'Huodongxing extraction did not return the expected structured payload.',
  );
}

export function extractEventRows(limit = 20) {
  return requireExtractionRows(extractEventRowsPayload(limit));
}

async function extractEventRowsFromPage(page, limit) {
  return page.evaluate(`(${extractEventRowsPayload.toString()})(${limit})`);
}

async function waitForEventCards(page) {
  await page.wait({ selector: RESULT_CARD_SELECTOR, timeout: 10 }).catch(async () => {
    await page.wait({ time: 1 });
  });
}

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Retry the command to rule out transient navigation issues
  2. Verify the site is reachable in a normal browser
  3. Update the CLI/extractor to match current site markup
  4. Log the raw payload to diagnose the unexpected shape
Defensive patterns

Strategy: try-catch

Type guard

const isKnownPayload = p => p && typeof p === 'object' && (p.ok === true || ['RATE_LIMIT','TRANSIENT_ACCESS','INVALID_LIMIT','EMPTY_RESULT'].includes(p.code));

Try / catch

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; }

Prevention

When it happens

Trigger: 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.

Common situations: Browser navigation interrupted; site layout overhaul breaking the extractor's contract entirely; captive portal or proxy injecting HTML into the evaluate result.

Understand the failure class

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/4f9e6d8be46419cf. Report an issue: GitHub.