MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / logError

Function logError

cli/src/utils/analytics.ts:286–309  ·  view source on GitHub ↗
(
  error: any,
  userId?: string,
  properties?: Record<string, any>,
)

Source from the content-addressed store, hash-verified

284}
285
286export function logError(
287 error: any,
288 userId?: string,
289 properties?: Record<string, any>,
290) {
291 if (!client) {
292 return
293 }
294
295 try {
296 client.captureException(
297 error,
298 userId ?? currentUserId ?? 'unknown',
299 properties,
300 )
301 } catch (postHogError) {
302 // Silently handle PostHog errors - don't log them to console
303 // This prevents PostHog connection issues from cluttering the user's console
304 logAnalyticsError(postHogError, {
305 stage: AnalyticsErrorStage.CaptureException,
306 properties,
307 })
308 }
309}

Callers 1

logAsErrorIfNeededFunction · 0.90

Calls 1

logAnalyticsErrorFunction · 0.85

Tested by

no test coverage detected