diff options
author | pacien | 2018-07-21 00:05:53 +0200 |
---|---|---|
committer | pacien | 2018-07-21 00:05:53 +0200 |
commit | 67ee634c9e1037708519bd42d348243aa9cea468 (patch) | |
tree | 9a36f5ff345e452cff4963bce00ff4d3cfbaa777 /pointless | |
parent | de8ee94abf69fa909f796decdbcde896573c0f61 (diff) | |
download | beamer-viewer-67ee634c9e1037708519bd42d348243aa9cea468.tar.gz |
Display message on loading error
Diffstat (limited to 'pointless')
-rw-r--r-- | pointless/viewer/viewer.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pointless/viewer/viewer.js b/pointless/viewer/viewer.js index 75486a4..e3a1043 100644 --- a/pointless/viewer/viewer.js +++ b/pointless/viewer/viewer.js | |||
@@ -20,6 +20,10 @@ class Viewer { | |||
20 | this.welcomeScreen.style.display = "none"; | 20 | this.welcomeScreen.style.display = "none"; |
21 | pdfjsLib.getDocument(source).then(function(pdf) { | 21 | pdfjsLib.getDocument(source).then(function(pdf) { |
22 | const presentation = new Presentation(pdf); | 22 | const presentation = new Presentation(pdf); |
23 | }).catch(function(error) { | ||
24 | console.error(error); | ||
25 | window.alert("Error while loading presentation:\n\n" + error.message); | ||
26 | window.location.href = window.location.pathname; // reload without "?file=..." | ||
23 | }); | 27 | }); |
24 | } | 28 | } |
25 | 29 | ||