Files
openmotion/shared/render-failure.ts
霜草 d3817f6e3f Recover transient cloud login and export failures and guide client updates (#1176)
* Recover transient cloud login and export failures and guide client updates

* Run source update guidance regression in PR CI

* Verify renderer failure causes from worker to telemetry sink

---------

Co-authored-by: qindong <qindong@qindongs-MacBook-Pro.local>
2026-11-30 10:24:11 +08:00

9 lines
522 B
TypeScript

import type { renderFailureReasons } from '../tracking/tool-fields.ts';
export function classifyRenderFailure(output: string): (typeof renderFailureReasons)[number] {
if (/listen (?:EPERM|EACCES).*?(?:127\.0\.0\.1|::1|localhost)/i.test(output)) return 'local_port_denied';
if (/Chrome cannot start|Failed to launch (?:the )?browser/i.test(output)) return 'browser_start';
if (/Error while opening encoder|Unknown encoder|Error initializing output stream/i.test(output)) return 'encoder';
return 'unclassified';
}