MCPcopy Create free account
hub / github.com/MicrosoftDocs/mcp / looksLikeUsageError

Function looksLikeUsageError

cli/src/index.ts:94–99  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

92 }
93
94 const maybeError = error as Record<string, unknown>;
95 return typeof maybeError.exitCode === 'number' && typeof maybeError.message === 'string';
96}
97
98function looksLikeUsageError(error: unknown): error is Error {
99 return (
100 error instanceof Error &&
101 /(missing required argument|unknown option|too many arguments|option .* argument missing)/i.test(error.message)
102 );

Callers 1

handleCliErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected