Capture sentry error if update page api is called without an id

This commit is contained in:
Hetu Nandu 2023-03-30 16:59:52 +05:30
parent 7786c4215a
commit c234474b89

View File

@ -659,6 +659,17 @@ export function* createPageSaga(
export function* updatePageSaga(action: ReduxAction<UpdatePageRequest>) {
try {
const request: UpdatePageRequest = action.payload;
// Update page *needs* id to be there. We found certain scenarios
// where this was not happening and capturing the error to know gather
// more info: https://github.com/appsmithorg/appsmith/issues/16435
if (!request.id) {
Sentry.captureException(
new Error("Attempting to update page without page id"),
);
return;
}
// to be done in backend
request.customSlug = request.customSlug?.replaceAll(" ", "-");