MCPcopy Create free account
hub / github.com/chhoumann/quickadd / reportError

Function reportError

src/utils/errorUtils.ts:106–127  ·  view source on GitHub ↗
(
  err: unknown, 
  contextMessage?: string,
  level: ErrorLevel = ErrorLevelEnum.Error
)

Source from the content-addressed store, hash-verified

104 * ```
105 */
106export function reportError(
107 err: unknown,
108 contextMessage?: string,
109 level: ErrorLevel = ErrorLevelEnum.Error
110): void {
111 const error = toError(err, contextMessage);
112
113 switch (level) {
114 case ErrorLevelEnum.Error:
115 log.logError(error);
116 break;
117 case ErrorLevelEnum.Warning:
118 log.logWarning(error);
119 break;
120 case ErrorLevelEnum.Log:
121 log.logMessage(error);
122 break;
123 default:
124 // Ensure exhaustiveness
125 log.logError(error);
126 }
127}
128
129/**
130 * Error boundary - wraps a function and reports any errors it throws

Callers 15

runUriChoiceLegacyMethod · 0.90
addCommandForChoiceMethod · 0.90
executeWithOutcomeMethod · 0.90
GetApiMethod · 0.90
overwriteTemplaterOnceFunction · 0.90
createFileWithTemplateFunction · 0.90
appendToFileWithTemplateFunction · 0.90
runMethod · 0.90
runTemplateFromFolderFunction · 0.90
runMethod · 0.90
runMethod · 0.90

Calls 4

toErrorFunction · 0.70
logErrorMethod · 0.65
logWarningMethod · 0.65
logMessageMethod · 0.65

Tested by

no test coverage detected