chore: fix cannot read properties of null (reading 'id') sentry error (#15323)
This commit is contained in:
parent
e5d89e7099
commit
526f2a8be6
|
|
@ -40,7 +40,12 @@ import history from "utils/history";
|
||||||
import PerformanceTracker, {
|
import PerformanceTracker, {
|
||||||
PerformanceTransactionName,
|
PerformanceTransactionName,
|
||||||
} from "utils/PerformanceTracker";
|
} from "utils/PerformanceTracker";
|
||||||
import AppEngine, { AppEnginePayload } from ".";
|
import AppEngine, {
|
||||||
|
ActionsNotFoundError,
|
||||||
|
AppEnginePayload,
|
||||||
|
PluginFormConfigsNotFoundError,
|
||||||
|
PluginsNotFoundError,
|
||||||
|
} from ".";
|
||||||
|
|
||||||
export default class AppEditorEngine extends AppEngine {
|
export default class AppEditorEngine extends AppEngine {
|
||||||
constructor(mode: APP_MODE) {
|
constructor(mode: APP_MODE) {
|
||||||
|
|
@ -114,7 +119,10 @@ export default class AppEditorEngine extends AppEngine {
|
||||||
failureActionEffects,
|
failureActionEffects,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!allActionCalls) return;
|
if (!allActionCalls)
|
||||||
|
throw new ActionsNotFoundError(
|
||||||
|
`Unable to fetch actions for the application: ${applicationId}`,
|
||||||
|
);
|
||||||
yield put(fetchAllPageEntityCompletion([executePageLoadActions()]));
|
yield put(fetchAllPageEntityCompletion([executePageLoadActions()]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -147,7 +155,8 @@ export default class AppEditorEngine extends AppEngine {
|
||||||
errorActions,
|
errorActions,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!initActionCalls) return;
|
if (!initActionCalls)
|
||||||
|
throw new PluginsNotFoundError("Unable to fetch plugins");
|
||||||
|
|
||||||
const pluginFormCall: boolean = yield call(
|
const pluginFormCall: boolean = yield call(
|
||||||
failFastApiCalls,
|
failFastApiCalls,
|
||||||
|
|
@ -155,7 +164,10 @@ export default class AppEditorEngine extends AppEngine {
|
||||||
[ReduxActionTypes.FETCH_PLUGIN_FORM_CONFIGS_SUCCESS],
|
[ReduxActionTypes.FETCH_PLUGIN_FORM_CONFIGS_SUCCESS],
|
||||||
[ReduxActionErrorTypes.FETCH_PLUGIN_FORM_CONFIGS_ERROR],
|
[ReduxActionErrorTypes.FETCH_PLUGIN_FORM_CONFIGS_ERROR],
|
||||||
);
|
);
|
||||||
if (!pluginFormCall) return;
|
if (!pluginFormCall)
|
||||||
|
throw new PluginFormConfigsNotFoundError(
|
||||||
|
"Unable to fetch plugin form configs",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public *loadAppEntities(toLoadPageId: string, applicationId: string): any {
|
public *loadAppEntities(toLoadPageId: string, applicationId: string): any {
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import { failFastApiCalls } from "sagas/InitSagas";
|
||||||
import PerformanceTracker, {
|
import PerformanceTracker, {
|
||||||
PerformanceTransactionName,
|
PerformanceTransactionName,
|
||||||
} from "utils/PerformanceTracker";
|
} from "utils/PerformanceTracker";
|
||||||
import AppEngine, { AppEnginePayload } from ".";
|
import AppEngine, { ActionsNotFoundError, AppEnginePayload } from ".";
|
||||||
|
|
||||||
export default class AppViewerEngine extends AppEngine {
|
export default class AppViewerEngine extends AppEngine {
|
||||||
constructor(mode: APP_MODE) {
|
constructor(mode: APP_MODE) {
|
||||||
|
|
@ -93,7 +93,10 @@ export default class AppViewerEngine extends AppEngine {
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!resultOfPrimaryCalls) return;
|
if (!resultOfPrimaryCalls)
|
||||||
|
throw new ActionsNotFoundError(
|
||||||
|
`Unable to fetch actions for the application: ${applicationId}`,
|
||||||
|
);
|
||||||
|
|
||||||
yield put(fetchAllPageEntityCompletion([executePageLoadActions()]));
|
yield put(fetchAllPageEntityCompletion([executePageLoadActions()]));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,11 @@ export interface IAppEngine {
|
||||||
completeChore(): any;
|
completeChore(): any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class PageNotFoundError extends Error {}
|
export class AppEngineApiError extends Error {}
|
||||||
|
export class PageNotFoundError extends AppEngineApiError {}
|
||||||
|
export class ActionsNotFoundError extends AppEngineApiError {}
|
||||||
|
export class PluginsNotFoundError extends AppEngineApiError {}
|
||||||
|
export class PluginFormConfigsNotFoundError extends AppEngineApiError {}
|
||||||
|
|
||||||
export default abstract class AppEngine {
|
export default abstract class AppEngine {
|
||||||
private _mode: APP_MODE;
|
private _mode: APP_MODE;
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,8 @@ import { getIsInitialized as getIsViewerInitialized } from "selectors/appViewSel
|
||||||
import { enableGuidedTour } from "actions/onboardingActions";
|
import { enableGuidedTour } from "actions/onboardingActions";
|
||||||
import { setPreviewModeAction } from "actions/editorActions";
|
import { setPreviewModeAction } from "actions/editorActions";
|
||||||
import AppEngine, {
|
import AppEngine, {
|
||||||
|
AppEngineApiError,
|
||||||
AppEnginePayload,
|
AppEnginePayload,
|
||||||
PageNotFoundError,
|
|
||||||
} from "entities/Engine";
|
} from "entities/Engine";
|
||||||
import AppEngineFactory from "entities/Engine/factory";
|
import AppEngineFactory from "entities/Engine/factory";
|
||||||
import { ApplicationPagePayload } from "api/ApplicationApi";
|
import { ApplicationPagePayload } from "api/ApplicationApi";
|
||||||
|
|
@ -95,8 +95,8 @@ export function* startAppEngine(action: ReduxAction<AppEnginePayload>) {
|
||||||
engine.stopPerformanceTracking();
|
engine.stopPerformanceTracking();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log.error(e);
|
log.error(e);
|
||||||
|
if (e instanceof AppEngineApiError) return;
|
||||||
Sentry.captureException(e);
|
Sentry.captureException(e);
|
||||||
if (e instanceof PageNotFoundError) return;
|
|
||||||
yield put({
|
yield put({
|
||||||
type: ReduxActionTypes.SAFE_CRASH_APPSMITH_REQUEST,
|
type: ReduxActionTypes.SAFE_CRASH_APPSMITH_REQUEST,
|
||||||
payload: {
|
payload: {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user