MCPcopy Index your code
hub / github.com/codeaashu/claude-code / formatFailureDetails

Function formatFailureDetails

src/utils/plugins/marketplaceHelpers.ts:16–33  ·  view source on GitHub ↗
(
  failures: Array<{ name: string; reason?: string; error?: string }>,
  includeReasons: boolean,
)

Source from the content-addressed store, hash-verified

14 * @returns Formatted string like "plugin-a (reason); plugin-b (reason)" or "plugin-a, plugin-b"
15 */
16export function formatFailureDetails(
17 failures: Array<{ name: string; reason?: string; error?: string }>,
18 includeReasons: boolean,
19): string {
20 const maxShow = 2
21 const details = failures
22 .slice(0, maxShow)
23 .map(f => {
24 const reason = f.reason || f.error || 'unknown error'
25 return includeReasons ? `${f.name} (${reason})` : f.name
26 })
27 .join(includeReasons ? '; ' : ', ')
28
29 const remaining = failures.length - maxShow
30 const moreText = remaining > 0 ? ` and ${remaining} more` : ''
31
32 return `${details}${moreText}`
33}
34
35/**
36 * Extract source display string from marketplace configuration

Callers 2

installSelectedPluginsFunction · 0.85
installSelectedPluginsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected