Include Sentry tracing and additional indexes.

This commit is contained in:
Patrick Fic
2023-08-23 08:26:18 -07:00
parent ca248f3890
commit 7c6693a959
13 changed files with 40 additions and 27 deletions

View File

@@ -1,5 +1,6 @@
import { Button, Col, Collapse, Result, Row, Space } from "antd";
import React from "react";
import * as Sentry from "@sentry/electron";
class ErrorBoundary extends React.Component {
constructor() {
@@ -13,11 +14,13 @@ class ErrorBoundary extends React.Component {
static getDerivedStateFromError(error) {
console.log("ErrorBoundary -> getDerivedStateFromError -> error", error);
Sentry.captureException(error);
return { hasErrored: true, error: error };
}
componentDidCatch(error, info) {
console.log("Exception Caught by Error Boundary.", error, info);
Sentry.captureException(error);
this.setState({ ...this.state, error, info });
}

View File

@@ -7,6 +7,7 @@ import { WebSocketLink } from "@apollo/client/link/ws";
import { getMainDefinition } from "@apollo/client/utilities";
import apolloLogger from "apollo-link-logger";
import { auth } from "../firebase/firebase.utils";
import { SentryLink } from "apollo-link-sentry";
const errorLink = onError(
({ graphQLErrors, networkError, operation, forward }) => {
@@ -106,12 +107,16 @@ const retryLink = new RetryLink({
},
});
const sentryLink = new SentryLink();
const middlewares = [];
if (process.env.NODE_ENV === "development") {
middlewares.push(apolloLogger);
}
middlewares.push(retryLink.concat(errorLink.concat(authLink.concat(link))));
middlewares.push(
sentryLink.concat(retryLink.concat(errorLink.concat(authLink.concat(link))))
);
const cache = new InMemoryCache({});