From 28bff9cecebe74ee76aee6259333fedda3b91971 Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Wed, 27 Jul 2016 13:51:09 +0200 Subject: [PATCH] Fix a bug with error handling in API middleware --- app/middleware/api.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/middleware/api.js b/app/middleware/api.js index a2a8557..1a2b92f 100644 --- a/app/middleware/api.js +++ b/app/middleware/api.js @@ -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)); } } );