Skip to content

Commit

Permalink
chore(dev): fix sentry dedupe of useNodevalue error
Browse files Browse the repository at this point in the history
  • Loading branch information
bcsherma committed Oct 10, 2024
1 parent 5579795 commit 8af416b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions weave-js/src/react.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as Sentry from '@sentry/react';
import {
callOpVeryUnsafe,
Client,
Expand Down Expand Up @@ -48,6 +47,7 @@ import {
useState,
} from 'react';

import {captureAndThrowError} from './common/util/sentry';
import {WEAVE_REF_PREFIX} from './components/PagePanelComponents/Home/Browse3/pages/wfReactInterface/constants';
import {PanelCompContext} from './components/Panel2/PanelComp';
import {usePanelContext} from './components/Panel2/PanelContext';
Expand Down Expand Up @@ -352,12 +352,11 @@ export const useNodeValue = <T extends Type>(
// Just rethrow the error in the render thread so it can be caught
// by an error boundary.
if (error != null) {
const message =
'Node execution failed (useNodeValue): ' + errorToText(error);
// console.error(message);
const message = `Node execution failed (useNodeValue): ${errorToText(
error
)}`;
const err = new UseNodeValueServerExecutionError(message);
Sentry.captureException(err, {fingerprint: ['useNodeValue']});
throw err;
captureAndThrowError(err, {fingerprint: ['useNodeValue']});
}
if (isConstNode(node)) {
if (isFunction(node.type)) {
Expand Down

0 comments on commit 8af416b

Please sign in to comment.