From 67ee634c9e1037708519bd42d348243aa9cea468 Mon Sep 17 00:00:00 2001 From: pacien Date: Sat, 21 Jul 2018 00:05:53 +0200 Subject: Display message on loading error --- pointless/viewer/viewer.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pointless/viewer') 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 { this.welcomeScreen.style.display = "none"; pdfjsLib.getDocument(source).then(function(pdf) { const presentation = new Presentation(pdf); + }).catch(function(error) { + console.error(error); + window.alert("Error while loading presentation:\n\n" + error.message); + window.location.href = window.location.pathname; // reload without "?file=..." }); } -- cgit v1.2.3