Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (18 sloc) 513 Bytes
// () =>
// (store: Store) =>
// (next: (action: Action) => Object) =>
// errSaga(action: Action) => Object|Void
export default () => ({ dispatch }) => next => {
return function errorSaga(action) {
if (!action.error) { return next(action); }
console.error(action.error);
dispatch({
type: 'app.makeToast',
payload: {
type: 'error',
title: 'Oops, something went wrong',
message: `Something went wrong, please try again later`
}
});
};
};
Something went wrong with that request. Please try again.