feat: (wip) add error reporting
This commit is contained in:
23
app/assets/javascripts/services/errorReporting.ts
Normal file
23
app/assets/javascripts/services/errorReporting.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { isDesktopApplication, isDev } from '@/utils';
|
||||
import { storage, StorageKey } from './localStorage';
|
||||
import Bugsnag from '@bugsnag/js';
|
||||
|
||||
declare const __VERSION__: string;
|
||||
|
||||
export async function startErrorReporting() {
|
||||
if (storage.get(StorageKey.DisableErrorReporting)) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Bugsnag.start({
|
||||
apiKey: (window as any)._bugsnag_api_key,
|
||||
appType: isDesktopApplication() ? 'desktop' : 'web',
|
||||
appVersion: __VERSION__,
|
||||
collectUserIp: false,
|
||||
autoTrackSessions: false,
|
||||
releaseStage: isDev ? 'development' : undefined
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Failed to start Bugsnag.', error);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user