aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpacien2018-07-21 00:05:53 +0200
committerpacien2018-07-21 00:05:53 +0200
commit67ee634c9e1037708519bd42d348243aa9cea468 (patch)
tree9a36f5ff345e452cff4963bce00ff4d3cfbaa777
parentde8ee94abf69fa909f796decdbcde896573c0f61 (diff)
downloadbeamer-viewer-67ee634c9e1037708519bd42d348243aa9cea468.tar.gz
Display message on loading error
-rw-r--r--pointless/viewer/viewer.js4
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