MCPcopy
hub / github.com/codeaashu/claude-code / safeCallProgress

Function safeCallProgress

src/utils/plugins/marketplaceManager.ts:1007–1019  ·  view source on GitHub ↗

* Safely invoke a progress callback, catching and logging any errors. * Prevents callback errors from aborting marketplace operations. * * @param onProgress - The progress callback to invoke * @param message - Progress message to pass to the callback

(
  onProgress: MarketplaceProgressCallback | undefined,
  message: string,
)

Source from the content-addressed store, hash-verified

1005 * @param message - Progress message to pass to the callback
1006 */
1007function safeCallProgress(
1008 onProgress: MarketplaceProgressCallback | undefined,
1009 message: string,
1010): void {
1011 if (!onProgress) return
1012 try {
1013 onProgress(message)
1014 } catch (callbackError) {
1015 logForDebugging(`Progress callback error: ${errorMessage(callbackError)}`, {
1016 level: 'warn',
1017 })
1018 }
1019}
1020
1021/**
1022 * Reconcile the on-disk sparse-checkout state with the desired config.

Callers 4

cacheMarketplaceFromGitFunction · 0.85
cacheMarketplaceFromUrlFunction · 0.85
loadAndCacheMarketplaceFunction · 0.85
refreshMarketplaceFunction · 0.85

Calls 3

logForDebuggingFunction · 0.85
onProgressFunction · 0.50
errorMessageFunction · 0.50

Tested by

no test coverage detected