fix: pass error message #2253

Merged
tzarebczan merged 2 commits from fix-download-error into master 2019-02-01 18:10:17 +01:00
3 changed files with 8 additions and 3 deletions

View file

@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Flow errors ([#2213](https://github.com/lbryio/lbry-desktop/pull/2213)) - Flow errors ([#2213](https://github.com/lbryio/lbry-desktop/pull/2213))
- Video position on previously viewed files ([#2240](https://github.com/lbryio/lbry-desktop/pull/2240)) - Video position on previously viewed files ([#2240](https://github.com/lbryio/lbry-desktop/pull/2240))
- Pass download error details on modal ([#2255](https://github.com/lbryio/lbry-desktop/pull/2255))
## [0.27.1] - 2018-01-22 ## [0.27.1] - 2018-01-22

View file

@ -180,12 +180,13 @@ function handleLoadVideoError(uri, errorType = '') {
data: { uri }, data: { uri },
}); });
dispatch(doSetPlayingUri(null)); dispatch(doSetPlayingUri(null));
// this is not working, but should be it's own separate modal in the future (https://github.com/lbryio/lbry-desktop/issues/892)
if (errorType === 'timeout') { if (errorType === 'timeout') {
doOpenModal(MODALS.FILE_TIMEOUT, { uri }); doOpenModal(MODALS.FILE_TIMEOUT, { uri });
} else { } else {
dispatch( dispatch(
doError( doError(
`Failed to download ${uri}, please try again. If this problem persists, visit https://lbry.io/faq/support for support.` `Failed to download ${uri}, please try again or see error details:\n\n${errorType}\n\nIf this problem persists, visit https://lbry.io/support for help. `
) )
); );
} }
@ -204,6 +205,7 @@ export function doLoadVideo(uri, shouldRecordViewEvent) {
Lbry.get({ uri }) Lbry.get({ uri })
.then(streamInfo => { .then(streamInfo => {
// need error code from SDK to capture properly
const timeout = const timeout =
streamInfo === null || typeof streamInfo !== 'object' || streamInfo.error === 'Timeout'; streamInfo === null || typeof streamInfo !== 'object' || streamInfo.error === 'Timeout';
@ -221,8 +223,8 @@ export function doLoadVideo(uri, shouldRecordViewEvent) {
} }
} }
}) })
.catch(() => { .catch(error => {
dispatch(handleLoadVideoError(uri)); dispatch(handleLoadVideoError(uri, error));
}); });
}; };
} }

View file

@ -107,6 +107,7 @@
.error-modal { .error-modal {
max-width: none; max-width: none;
width: var(--modal-width); width: var(--modal-width);
white-space: pre-wrap;
} }
.error-modal__error-list { .error-modal__error-list {
@ -120,4 +121,5 @@
color: $lbry-red-5; color: $lbry-red-5;
list-style: none; list-style: none;
overflow-y: scroll; overflow-y: scroll;
white-space: pre-wrap;
} }