added a check for errors without payloads

This commit is contained in:
Nikhil Nandagopal 2020-12-09 12:32:27 +05:30
parent e0ac6e9850
commit 0fc5817caa

View File

@ -87,7 +87,7 @@ export function* errorSaga(
// Just a pass through for now.
// Add procedures to customize errors here
log.debug(`Error in action ${errorAction.type}`);
log.error(errorAction.payload.error);
if (errorAction.payload) log.error(errorAction.payload.error);
// Show a toast when the error occurs
const {
type,
@ -105,7 +105,7 @@ export function* errorSaga(
yield put({
type: ReduxActionTypes.REPORT_ERROR,
payload: {
message: errorAction.payload.error,
message: errorAction.payload ? errorAction.payload.error : undefined,
source: errorAction.type,
},
});