add analytics log on app crash (#14575)
This commit is contained in:
parent
7ba4f0679a
commit
ed59802702
|
|
@ -3,6 +3,7 @@ import styled from "styled-components";
|
||||||
import AppCrashImage from "assets/images/404-image.png";
|
import AppCrashImage from "assets/images/404-image.png";
|
||||||
import * as Sentry from "@sentry/react";
|
import * as Sentry from "@sentry/react";
|
||||||
import log from "loglevel";
|
import log from "loglevel";
|
||||||
|
import AnalyticsUtil from "utils/AnalyticsUtil";
|
||||||
|
|
||||||
const Wrapper = styled.div`
|
const Wrapper = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -42,6 +43,7 @@ class AppErrorBoundary extends Component {
|
||||||
componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
|
componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
|
||||||
log.error({ error, errorInfo });
|
log.error({ error, errorInfo });
|
||||||
Sentry.captureException(error);
|
Sentry.captureException(error);
|
||||||
|
AnalyticsUtil.logEvent("APP_CRASH", { error, errorInfo });
|
||||||
this.setState({
|
this.setState({
|
||||||
hasError: true,
|
hasError: true,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ export type EventLocation =
|
||||||
| "OMNIBAR";
|
| "OMNIBAR";
|
||||||
|
|
||||||
export type EventName =
|
export type EventName =
|
||||||
|
| "APP_CRASH"
|
||||||
| "SWITCH_DATASOURCE"
|
| "SWITCH_DATASOURCE"
|
||||||
| "LOGIN_CLICK"
|
| "LOGIN_CLICK"
|
||||||
| "SIGNUP_CLICK"
|
| "SIGNUP_CLICK"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user