MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / diagnosticsFromCommandFailure

Function diagnosticsFromCommandFailure

src/utils/diagnostics.ts:65–85  ·  view source on GitHub ↗
(
  response: CommandFailureDiagnosticInput,
  fallbackMessage = 'Unknown error',
)

Source from the content-addressed store, hash-verified

63}
64
65export function diagnosticsFromCommandFailure(
66 response: CommandFailureDiagnosticInput,
67 fallbackMessage = 'Unknown error',
68): BasicDiagnostics {
69 const stderrLines = response.error ? nonEmptyLines(response.error) : [];
70 const stdoutLines = response.output ? nonEmptyLines(response.output) : [];
71
72 if (stderrLines.length > 0) {
73 const diagnostics = createBasicDiagnostics({ errors: stderrLines });
74 if (stdoutLines.length > 0 && stdoutLines.join('\n') !== stderrLines.join('\n')) {
75 diagnostics.rawOutput = stdoutLines;
76 }
77 return diagnostics;
78 }
79
80 if (stdoutLines.length > 0) {
81 return createBasicDiagnostics({ errors: stdoutLines });
82 }
83
84 return diagnosticsFromErrorMessage(fallbackMessage);
85}

Callers 3

Calls 3

nonEmptyLinesFunction · 0.85
createBasicDiagnosticsFunction · 0.70

Tested by

no test coverage detected