From 88dbef2cd0f590a8cd117c331df950489f4050b8 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 12 Nov 2020 13:27:03 -0500 Subject: [PATCH] pass error to fatal action handler --- dist/bundle.es.js | 8 +++++--- src/redux/actions/sync.js | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 33e7afd..06b5618 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -1770,9 +1770,10 @@ function doPreferenceSet(key, value, version, success, fail) { lbryProxy.preference_set(options).then(() => { success(preference); - }).catch(() => { + }).catch(err => { dispatch({ - type: SYNC_FATAL_ERROR + type: SYNC_FATAL_ERROR, + error: err }); if (fail) { @@ -1797,7 +1798,8 @@ function doPreferenceGet(key, success, fail) { return success(null); }).catch(err => { dispatch({ - type: SYNC_FATAL_ERROR + type: SYNC_FATAL_ERROR, + error: err }); if (fail) { diff --git a/src/redux/actions/sync.js b/src/redux/actions/sync.js index c5c0889..c1f9b65 100644 --- a/src/redux/actions/sync.js +++ b/src/redux/actions/sync.js @@ -90,9 +90,10 @@ export function doPreferenceSet( .then(() => { success(preference); }) - .catch(() => { + .catch(err => { dispatch({ type: ACTIONS.SYNC_FATAL_ERROR, + error: err, }); if (fail) { @@ -120,6 +121,7 @@ export function doPreferenceGet(key: string, success: Function, fail?: Function) .catch(err => { dispatch({ type: ACTIONS.SYNC_FATAL_ERROR, + error: err, }); if (fail) {