1
0
mirror of https://github.com/XFox111/TabsAsideExtension.git synced 2026-04-22 07:58:01 +03:00

hotfix: wrapped analytics into try/catch to prevent failing on firefox

This commit is contained in:
2025-05-07 00:03:43 +03:00
parent f5bf0db039
commit 8b77159abe
10 changed files with 43 additions and 18 deletions
+1
View File
@@ -1,2 +1,3 @@
export { default as userPropertiesStorage } from "./utils/userPropertiesStorage";
export { default as trackError } from "./utils/trackError";
export { default as track } from "./utils/track";
+11
View File
@@ -0,0 +1,11 @@
export default function track(eventName: string, eventProperties?: Record<string, string>): void
{
try
{
analytics.track(eventName, eventProperties);
}
catch (ex)
{
console.error("Failed to send analytics event", ex);
}
}
+12 -5
View File
@@ -1,8 +1,15 @@
export default function trackError(name: string, error: Error): void
{
analytics.track(name, {
name: error.name,
message: error.message,
stack: error.stack ?? "no_stack"
});
try
{
analytics.track(name, {
name: error.name,
message: error.message,
stack: error.stack ?? "no_stack"
});
}
catch (ex)
{
console.error("Failed to send error report", ex);
}
}