added a check for errors without payloads
This commit is contained in:
parent
e0ac6e9850
commit
0fc5817caa
|
|
@ -87,7 +87,7 @@ export function* errorSaga(
|
||||||
// Just a pass through for now.
|
// Just a pass through for now.
|
||||||
// Add procedures to customize errors here
|
// Add procedures to customize errors here
|
||||||
log.debug(`Error in action ${errorAction.type}`);
|
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
|
// Show a toast when the error occurs
|
||||||
const {
|
const {
|
||||||
type,
|
type,
|
||||||
|
|
@ -105,7 +105,7 @@ export function* errorSaga(
|
||||||
yield put({
|
yield put({
|
||||||
type: ReduxActionTypes.REPORT_ERROR,
|
type: ReduxActionTypes.REPORT_ERROR,
|
||||||
payload: {
|
payload: {
|
||||||
message: errorAction.payload.error,
|
message: errorAction.payload ? errorAction.payload.error : undefined,
|
||||||
source: errorAction.type,
|
source: errorAction.type,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user