From 38c7ef94cd65955020e2eb488e91a406b3a97096 Mon Sep 17 00:00:00 2001 From: Shawn Erquhart <shawn@erquh.art> Date: Sat, 3 Mar 2018 22:12:39 -0500 Subject: [PATCH] report loadUnpublishedEntries errors --- src/actions/editorialWorkflow.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/actions/editorialWorkflow.js b/src/actions/editorialWorkflow.js index 92b9f57c..96c2f805 100644 --- a/src/actions/editorialWorkflow.js +++ b/src/actions/editorialWorkflow.js @@ -243,10 +243,17 @@ export function loadUnpublishedEntries(collections) { if (state.config.get('publish_mode') !== EDITORIAL_WORKFLOW) return; const backend = currentBackend(state.config); dispatch(unpublishedEntriesLoading()); - backend.unpublishedEntries(collections).then( - response => dispatch(unpublishedEntriesLoaded(response.entries, response.pagination)), - error => dispatch(unpublishedEntriesFailed(error)) - ); + backend.unpublishedEntries(collections) + .then(response => dispatch(unpublishedEntriesLoaded(response.entries, response.pagination))) + .catch(error => { + dispatch(notifSend({ + message: `Error loading entries: ${ error }`, + kind: 'danger', + dismissAfter: 8000, + })); + dispatch(unpublishedEntriesFailed(error)); + Promise.reject(error) + }); }; }