MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / notifyErrorChannel

Function notifyErrorChannel

server/src/utils/posthog.ts:233–250  ·  view source on GitHub ↗
(module: string, message: string, error?: Error)

Source from the content-addressed store, hash-verified

231let notifyingErrorChannel = false;
232
233function notifyErrorChannel(module: string, message: string, error?: Error): void {
234 if (notifyingErrorChannel) return;
235 notifyingErrorChannel = true;
236
237 import('../addie/error-notifier.js')
238 .then(({ notifySystemError }) => {
239 const errorDetail = error?.message && error.message !== message
240 ? sanitizeForSlack(`${message}: ${error.message}`)
241 : sanitizeForSlack(message);
242 const stack = error?.stack ? `\n\`\`\`${sanitizeForSlack(error.stack.slice(0, 500))}\`\`\`` : '';
243 notifySystemError({
244 source: module || 'unknown',
245 errorMessage: errorDetail + stack,
246 });
247 })
248 .catch(() => {})
249 .finally(() => { notifyingErrorChannel = false; });
250}
251
252/**
253 * Send a Slack notification for fatal-level errors.

Callers 1

initPostHogErrorTrackingFunction · 0.85

Calls 2

sanitizeForSlackFunction · 0.85
notifySystemErrorFunction · 0.85

Tested by

no test coverage detected