Catch Data Tree update error and better sentry logging (#6627)

This commit is contained in:
Hetu Nandu 2021-08-16 18:12:15 +05:30 committed by GitHub
parent 22e477da8f
commit 25a6590b47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@ import { ReduxAction, ReduxActionTypes } from "constants/ReduxActionConstants";
import { applyChange, Diff } from "deep-diff";
import { DataTree } from "entities/DataTree/dataTreeFactory";
import { createImmerReducer } from "utils/AppsmithUtils";
import * as Sentry from "@sentry/react";
export type EvaluatedTreeState = DataTree;
@ -25,7 +26,16 @@ const evaluatedTreeReducer = createImmerReducer(initialState, {
if (!Array.isArray(update.path) || update.path.length === 0) {
continue;
}
applyChange(state, undefined, update);
try {
applyChange(state, undefined, update);
} catch (e) {
Sentry.captureException(e, {
extra: {
update,
updateLength: updates.length,
},
});
}
}
},
[ReduxActionTypes.FETCH_PAGE_INIT]: () => initialState,