Fix a bug with error handling in API middleware

This commit is contained in:
Lucas Verney 2016-07-27 13:51:09 +02:00
parent 942d123791
commit 28bff9cece

View File

@ -242,7 +242,10 @@ export default store => next => reduxAction => {
},
error => {
if (failureDispatch) {
store.dispatch(failureDispatch(error.message));
if (typeof error !== "string") {
error = error.message;
}
store.dispatch(failureDispatch(error));
}
}
);