jackwener/OpenCLI · error · CommandExecutionError

Failed to list xiaoe courses: ${message}

Error message

Failed to list xiaoe courses: ${message}

What it means

getXiaoeCourses loads https://study.xiaoe-tech.com/ in a browser and evaluates buildCoursesScript() to list purchased courses. Any throw from goto or evaluate is wrapped in this CommandExecutionError with the message 'Failed to list xiaoe courses: <inner>' and a hint that the page may not have rendered or auth may be required.

Source

Thrown at clis/xiaoe/courses.js:99

    var entry = matchEntry(title, cards[c].__vue__, 0);
    results.push({
      title: title,
      shop: entry ? (entry.shop_name || entry.app_name || '') : '',
      url: entry ? buildCourseUrl(entry) : '',
    });
  }
  return results;
})()`;
}

async function getXiaoeCourses(page) {
    let rows;
    try {
        await page.goto('https://study.xiaoe-tech.com/', { waitUntil: 'load', settleMs: 8000 });
        rows = await page.evaluate(buildCoursesScript());
    } catch (error) {
        const message = error instanceof Error ? error.message : String(error);
        throw new CommandExecutionError(
            `Failed to list xiaoe courses: ${message}`,
            'page may not have rendered or auth may be required',
        );
    }
    if (!Array.isArray(rows) || rows.length === 0) {
        throw new EmptyResultError(
            'xiaoe/courses',
            'No purchased courses found — login session may have expired or the "内容" tab has no items',
        );
    }
    return rows;
}

export const coursesCommand = cli({
    site: 'xiaoe',
    name: 'courses',
    access: 'read',
    description: '列出已购小鹅通课程(含 URL 和店铺名)',

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Re-authenticate the xiaoe account and retry
  2. Check network/proxy access to study.xiaoe-tech.com
  3. Retry — transient load flakiness with the 8s settle window is possible
  4. Read the inner message (after the colon) for the exact root cause
Defensive patterns

Strategy: try-catch

Validate before calling

// check reachability of the courses portal first
const res = await fetch('https://study.xiaoe-tech.com/', { method: 'HEAD' }).catch(() => null);
if (!res) throw new Error('study.xiaoe-tech.com unreachable');

Type guard

null

Try / catch

try {
  const courses = await getXiaoeCourses();
} catch (e) {
  if (e.name === 'CommandExecutionError' && e.message.startsWith('Failed to list xiaoe courses')) {
    console.error('Courses load failed:', e.message, '— hint:', e.hint);
    // re-auth, check network, retry
  } else throw e;
}

Prevention

When it happens

Trigger: Navigation to study.xiaoe-tech.com fails (network/DNS/TLS/timeout) or the courses page script throws during evaluate (login redirect page, unexpected DOM, runtime error).

Common situations: Login session expired so the site redirects to an auth page; study.xiaoe-tech.com is slow to load and 8000ms settle is insufficient; corporate proxy blocks the domain; front-end update breaks the script.

Related errors


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