( error: any, userId?: string, properties?: Record<string, any>, )
| 284 | } |
| 285 | |
| 286 | export 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 | } |
no test coverage detected