add analytics log on app crash (#14575)

This commit is contained in:
Anand Srinivasan 2022-06-22 16:00:33 +05:30 committed by GitHub
parent 7ba4f0679a
commit ed59802702
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -3,6 +3,7 @@ import styled from "styled-components";
import AppCrashImage from "assets/images/404-image.png";
import * as Sentry from "@sentry/react";
import log from "loglevel";
import AnalyticsUtil from "utils/AnalyticsUtil";
const Wrapper = styled.div`
display: flex;
@ -42,6 +43,7 @@ class AppErrorBoundary extends Component {
componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
log.error({ error, errorInfo });
Sentry.captureException(error);
AnalyticsUtil.logEvent("APP_CRASH", { error, errorInfo });
this.setState({
hasError: true,
});

View File

@ -15,6 +15,7 @@ export type EventLocation =
| "OMNIBAR";
export type EventName =
| "APP_CRASH"
| "SWITCH_DATASOURCE"
| "LOGIN_CLICK"
| "SIGNUP_CLICK"