MCPcopy Create free account
hub / github.com/callstack/agent-device / firstStderrLine

Function firstStderrLine

src/kernel/errors.ts:120–134  ·  view source on GitHub ↗
(stderr: string)

Source from the content-addressed store, hash-verified

118}
119
120function firstStderrLine(stderr: string): string | null {
121 const skipPatterns = [
122 /^an error was encountered processing the command/i,
123 /^underlying error\b/i,
124 /^simulator device failed to complete the requested operation/i,
125 ];
126
127 for (const rawLine of stderr.split('\n')) {
128 const line = rawLine.trim();
129 if (!line) continue;
130 if (skipPatterns.some((pattern) => pattern.test(line))) continue;
131 return line.length > 200 ? `${line.slice(0, 200)}...` : line;
132 }
133 return null;
134}
135
136function stripDiagnosticMeta(
137 details: Record<string, unknown> | undefined,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…