refactor: add extra data to sentry logs

This commit is contained in:
Carlos Valente
2024-08-28 18:29:14 +02:00
committed by Carlos Valente
parent 3877e207d0
commit 81f0e61953
@@ -28,9 +28,11 @@ class ErrorBoundary extends React.Component {
}); });
Sentry.withScope((scope) => { Sentry.withScope((scope) => {
scope.setExtras('error', error); scope.setExtras({
scope.setExtras('store', runtimeStore.getState()); error,
scope.setExtras('hasSocket', { hasConnected, shouldReconnect, reconnectAttempts }); store: runtimeStore.getState(),
hasSocket: { hasConnected, shouldReconnect, reconnectAttempts },
});
const eventId = Sentry.captureException(error); const eventId = Sentry.captureException(error);
this.setState({ eventId, info }); this.setState({ eventId, info });
}); });