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
- Re-authenticate the xiaoe account and retry
- Check network/proxy access to study.xiaoe-tech.com
- Retry — transient load flakiness with the 8s settle window is possible
- 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
- Keep the study.xiaoe-tech.com login session fresh
- Verify proxy/firewall allows study.xiaoe-tech.com before automation
- Retry once on first failure — the 8s settle window may be tight
- Read the inner message after 'Failed to list xiaoe courses:' for the root cause
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
- Failed to extract xiaoe content: ${message}
- Xiaoe XIAOEID/b_user_token cookie missing — anonymous
- xiaohongshu creator-note-detail: failed to read signed datac
- Unexpected 12306 probe: ${JSON.stringify(probe)}
- Waiting for 12306 tk auth cookie
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/e1421633049df01b.
Report an issue: GitHub.