Spaces:
Sleeping
Sleeping
Download src/lib/lovable-error-reporting.ts from launch-calcium/Grabber-In-Tanstack: direct link, hf CLI and curl.
- Browser
- Download file 830 Bytes
-
https://huggingface.co/spaces/launch-calcium/Grabber-In-Tanstack/resolve/main/src/lib/lovable-error-reporting.ts
- Command line
-
hf download hf://spaces/launch-calcium/Grabber-In-Tanstack/src/lib/lovable-error-reporting.ts
-
curl -L -o lovable-error-reporting.ts https://huggingface.co/spaces/launch-calcium/Grabber-In-Tanstack/resolve/main/src/lib/lovable-error-reporting.ts
830 Bytes
| type LovableErrorOptions = { | |
| mechanism?: "manual" | "onerror" | "unhandledrejection" | "react_error_boundary"; | |
| handled?: boolean; | |
| severity?: "error" | "warning" | "info"; | |
| }; | |
| type LovableEvents = { | |
| captureException?: ( | |
| error: unknown, | |
| context?: Record<string, unknown>, | |
| options?: LovableErrorOptions, | |
| ) => void; | |
| }; | |
| declare global { | |
| interface Window { | |
| __lovableEvents?: LovableEvents; | |
| } | |
| } | |
| export function reportLovableError(error: unknown, context: Record<string, unknown> = {}) { | |
| if (typeof window === "undefined") return; | |
| window.__lovableEvents?.captureException?.( | |
| error, | |
| { | |
| source: "react_error_boundary", | |
| route: window.location.pathname, | |
| ...context, | |
| }, | |
| { | |
| mechanism: "react_error_boundary", | |
| handled: false, | |
| severity: "error", | |
| }, | |
| ); | |
| } | |