default error code (#2363)

This commit is contained in:
Rishabh Saxena 2020-12-29 22:22:31 +05:30 committed by GitHub
parent 14effe6db1
commit 37d0314c2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ import {
ReduxActionErrorPayload,
} from "constants/ReduxActionConstants";
import { ERROR_CODES } from "constants/ApiConstants";
import _ from "lodash";
const initialState: ErrorReduxState = {
safeCrash: false,
@ -19,7 +20,7 @@ const errorReducer = createReducer(initialState, {
) => ({
...state,
safeCrash: true,
safeCrashCode: action.payload.code,
safeCrashCode: _.get(action, "payload.code", 502), // when the server is not responding
}),
[ReduxActionTypes.REPORT_ERROR]: (
state: ErrorReduxState,