MCPcopy
hub / github.com/opactorai/Claudable / detectCursorError

Function detectCursorError

lib/services/cli/cursor.ts:565–586  ·  view source on GitHub ↗
(stderrLines: string[])

Source from the content-addressed store, hash-verified

563 };
564
565function detectCursorError(stderrLines: string[]): CursorErrorKind | undefined {
566 if (stderrLines.length === 0) {
567 return undefined;
568 }
569 const lower = stderrLines.join(' ').toLowerCase();
570 if (lower.includes('resource_exhausted') || lower.includes('quota') || lower.includes('limit')) {
571 return 'resource_exhausted';
572 }
573 if (
574 lower.includes('connecterror') ||
575 lower.includes('connection refused') ||
576 lower.includes('timeout') ||
577 lower.includes('network') ||
578 lower.includes('dns')
579 ) {
580 return 'network';
581 }
582 if (lower.includes('unauthorized') || lower.includes('authentication') || lower.includes('api key')) {
583 return 'auth';
584 }
585 return undefined;
586}
587
588async function executeCursor(
589 projectId: string,

Callers 2

executeCursorFunction · 0.85
runCursorOnceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected