Initial sentry improvements to deploy and verify against test.

This commit is contained in:
Patrick Fic
2024-01-30 12:47:12 -08:00
parent ba30225ba1
commit 8bc1a9d9ee
11 changed files with 533 additions and 270 deletions

View File

@@ -1,17 +1,21 @@
import { onError } from "@apollo/client/link/error";
//https://stackoverflow.com/questions/57163454/refreshing-a-token-with-apollo-client-firebase-auth
import * as Sentry from "@sentry/react";
const errorLink = onError(
({ graphQLErrors, networkError, operation, forward }) => {
if (graphQLErrors)
graphQLErrors.forEach(({ message, locations, path }) =>
if (graphQLErrors) {
graphQLErrors.forEach(({ message, locations, path }) => {
console.log(
`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`
)
);
);
Sentry.captureException({ message, locations, path });
});
}
if (networkError)
console.log(`[Network error]: ${JSON.stringify(networkError)}`);
console.log(operation.getContext());
return forward(operation);
}
);