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, {
|
||||
PerformanceTransactionName,
|
||||
} from "utils/PerformanceTracker";
|
||||
import AppEngine, { AppEnginePayload } from ".";
|
||||
import AppEngine, {
|
||||
ActionsNotFoundError,
|
||||
AppEnginePayload,
|
||||
PluginFormConfigsNotFoundError,
|
||||
PluginsNotFoundError,
|
||||
} from ".";
|
||||
|
||||
export default class AppEditorEngine extends AppEngine {
|
||||
constructor(mode: APP_MODE) {
|
||||
|
|
@ -114,7 +119,10 @@ export default class AppEditorEngine extends AppEngine {
|
|||
failureActionEffects,
|
||||
);
|
||||
|
||||
if (!allActionCalls) return;
|
||||
if (!allActionCalls)
|
||||
throw new ActionsNotFoundError(
|
||||
`Unable to fetch actions for the application: ${applicationId}`,
|
||||
);
|
||||
yield put(fetchAllPageEntityCompletion([executePageLoadActions()]));
|
||||
}
|
||||
|
||||
|
|
@ -147,7 +155,8 @@ export default class AppEditorEngine extends AppEngine {
|
|||
errorActions,
|
||||
);
|
||||
|
||||
if (!initActionCalls) return;
|
||||
if (!initActionCalls)
|
||||
throw new PluginsNotFoundError("Unable to fetch plugins");
|
||||
|
||||
const pluginFormCall: boolean = yield call(
|
||||
failFastApiCalls,
|
||||
|
|
@ -155,7 +164,10 @@ export default class AppEditorEngine extends AppEngine {
|
|||
[ReduxActionTypes.FETCH_PLUGIN_FORM_CONFIGS_SUCCESS],
|
||||
[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 {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import { failFastApiCalls } from "sagas/InitSagas";
|
|||
import PerformanceTracker, {
|
||||
PerformanceTransactionName,
|
||||
} from "utils/PerformanceTracker";
|
||||
import AppEngine, { AppEnginePayload } from ".";
|
||||
import AppEngine, { ActionsNotFoundError, AppEnginePayload } from ".";
|
||||
|
||||
export default class AppViewerEngine extends AppEngine {
|
||||
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()]));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,11 @@ export interface IAppEngine {
|
|||
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 {
|
||||
private _mode: APP_MODE;
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ import { getIsInitialized as getIsViewerInitialized } from "selectors/appViewSel
|
|||
import { enableGuidedTour } from "actions/onboardingActions";
|
||||
import { setPreviewModeAction } from "actions/editorActions";
|
||||
import AppEngine, {
|
||||
AppEngineApiError,
|
||||
AppEnginePayload,
|
||||
PageNotFoundError,
|
||||
} from "entities/Engine";
|
||||
import AppEngineFactory from "entities/Engine/factory";
|
||||
import { ApplicationPagePayload } from "api/ApplicationApi";
|
||||
|
|
@ -95,8 +95,8 @@ export function* startAppEngine(action: ReduxAction<AppEnginePayload>) {
|
|||
engine.stopPerformanceTracking();
|
||||
} catch (e) {
|
||||
log.error(e);
|
||||
if (e instanceof AppEngineApiError) return;
|
||||
Sentry.captureException(e);
|
||||
if (e instanceof PageNotFoundError) return;
|
||||
yield put({
|
||||
type: ReduxActionTypes.SAFE_CRASH_APPSMITH_REQUEST,
|
||||
payload: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user