From 75c439f66d3b609767c463b30deb90f19d84ce3e Mon Sep 17 00:00:00 2001 From: Hetu Nandu Date: Mon, 5 Jul 2021 16:29:48 +0530 Subject: [PATCH] Handle exception where prepared statements viewer does not get a value (#5531) --- .../editorComponents/CodeEditor/EvaluatedValuePopup.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/client/src/components/editorComponents/CodeEditor/EvaluatedValuePopup.tsx b/app/client/src/components/editorComponents/CodeEditor/EvaluatedValuePopup.tsx index 049b3e288c..68edfbae49 100644 --- a/app/client/src/components/editorComponents/CodeEditor/EvaluatedValuePopup.tsx +++ b/app/client/src/components/editorComponents/CodeEditor/EvaluatedValuePopup.tsx @@ -15,6 +15,8 @@ import { EvaluationError, PropertyEvaluationErrorType, } from "utils/DynamicBindingUtils"; +import * as Sentry from "@sentry/react"; +import { Severity } from "@sentry/react"; const Wrapper = styled.div` position: relative; @@ -155,6 +157,13 @@ export function PreparedStatementViewer(props: { evaluatedValue: PreparedStatementValue; }) { const { parameters, value } = props.evaluatedValue; + if (!value) { + Sentry.captureException("Prepared Statement got no value", { + level: Severity.Debug, + extra: { props }, + }); + return
; + } const stringSegments = value.split(/\$\d/); const $params = [...value.matchAll(/\$\d/g)].map((matches) => matches[0]); const paramsWithTooltips = $params.map((param) => (