mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 13:28:11 +00:00
feat: setup posthog
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import React, { Component, ErrorInfo, ReactNode } from "react";
|
||||
|
||||
import { captureException } from "@/lib/posthog";
|
||||
|
||||
interface ErrorBoundaryProps {
|
||||
children: ReactNode;
|
||||
}
|
||||
@@ -20,7 +22,8 @@ export class ErrorBoundary extends Component<
|
||||
}
|
||||
|
||||
componentDidCatch(error: Error, info: ErrorInfo) {
|
||||
// Log to console in development; replace with a reporting service (e.g. Sentry) in production
|
||||
captureException(error, { componentStack: info.componentStack });
|
||||
|
||||
if (import.meta.env.DEV) {
|
||||
console.error("ErrorBoundary caught:", error, info.componentStack);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user