default error code (#2363)
This commit is contained in:
parent
14effe6db1
commit
37d0314c2a
|
|
@ -5,6 +5,7 @@ import {
|
||||||
ReduxActionErrorPayload,
|
ReduxActionErrorPayload,
|
||||||
} from "constants/ReduxActionConstants";
|
} from "constants/ReduxActionConstants";
|
||||||
import { ERROR_CODES } from "constants/ApiConstants";
|
import { ERROR_CODES } from "constants/ApiConstants";
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
const initialState: ErrorReduxState = {
|
const initialState: ErrorReduxState = {
|
||||||
safeCrash: false,
|
safeCrash: false,
|
||||||
|
|
@ -19,7 +20,7 @@ const errorReducer = createReducer(initialState, {
|
||||||
) => ({
|
) => ({
|
||||||
...state,
|
...state,
|
||||||
safeCrash: true,
|
safeCrash: true,
|
||||||
safeCrashCode: action.payload.code,
|
safeCrashCode: _.get(action, "payload.code", 502), // when the server is not responding
|
||||||
}),
|
}),
|
||||||
[ReduxActionTypes.REPORT_ERROR]: (
|
[ReduxActionTypes.REPORT_ERROR]: (
|
||||||
state: ErrorReduxState,
|
state: ErrorReduxState,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user