pass error to fatal action handler

This commit is contained in:
Sean Yesmunt 2020-11-12 13:27:03 -05:00
parent 8344379bfd
commit 88dbef2cd0
2 changed files with 8 additions and 4 deletions

8
dist/bundle.es.js vendored
View file

@ -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) {

View file

@ -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) {