Skip to content

Commit

Permalink
Sync changes from EE excluding enterprise directory
Browse files Browse the repository at this point in the history
  • Loading branch information
hetunandu committed Aug 23, 2024
1 parent 74a2ad2 commit 77ece2f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions app/client/src/sagas/ErrorSagas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ const getErrorMessageFromActionType = (
enum ErrorEffectTypes {
SHOW_ALERT = "SHOW_ALERT",
SAFE_CRASH = "SAFE_CRASH",
LOG_ERROR = "LOG_ERROR",
LOG_TO_CONSOLE = "LOG_TO_CONSOLE",
LOG_TO_SENTRY = "LOG_TO_SENTRY",
}

Expand All @@ -202,9 +202,9 @@ export interface ErrorActionPayload {
}

export function* errorSaga(errorAction: ReduxAction<ErrorActionPayload>) {
const effects = [ErrorEffectTypes.LOG_ERROR];
const effects = [ErrorEffectTypes.LOG_TO_CONSOLE];
const { payload, type } = errorAction;
const { error, logToSentry, show = true } = payload || {};
const { error, logToSentry, show } = payload || {};
const message = getErrorMessageFromActionType(type, error);

if (show) {
Expand All @@ -222,17 +222,15 @@ export function* errorSaga(errorAction: ReduxAction<ErrorActionPayload>) {

for (const effect of effects) {
switch (effect) {
case ErrorEffectTypes.LOG_ERROR: {
case ErrorEffectTypes.LOG_TO_CONSOLE: {
logErrorSaga(errorAction);
break;
}
case ErrorEffectTypes.SHOW_ALERT: {
// This is the toast that is rendered when any page load API fails.
yield call(showToast, message, { kind: "error" });

// TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if ((window as any).Cypress) {
if ("Cypress" in window) {
if (message === "" || message === null) {
yield put(
safeCrashApp({
Expand Down

0 comments on commit 77ece2f

Please sign in to comment.