diff --git a/apps/heatmap/init.js b/apps/heatmap/init.js index 6af0cea51..370a83d94 100644 --- a/apps/heatmap/init.js +++ b/apps/heatmap/init.js @@ -60,6 +60,10 @@ function initCore() { $CAMIC.loadImg(async function(e) { Loading.open(document.body, `Loading Data ...`); + $CAMIC.viewer.addHandler('open-failed', function(e){ + console.error(e.message, e) + redirect($D.pages.table, e.message, 5); + }) // image loaded if (e.hasError) { $UI.message.addError(e.message); diff --git a/apps/labeling/labeling.js b/apps/labeling/labeling.js index f7ce41e1e..06f530fe9 100644 --- a/apps/labeling/labeling.js +++ b/apps/labeling/labeling.js @@ -77,6 +77,10 @@ function initCore() { defaultText: `Slide: ${$D.params.data.name}`, }); } + $CAMIC.viewer.addHandler('open-failed', function(e){ + console.error(e.message, e) + redirect($D.pages.table, e.message, 5); + }) }); $CAMIC.viewer.addHandler('open', function() { diff --git a/apps/mini/init.js b/apps/mini/init.js index bbe10dac8..7dbd46172 100644 --- a/apps/mini/init.js +++ b/apps/mini/init.js @@ -161,6 +161,10 @@ function initCore() { } $CAMIC.loadImg(function(e) { + $CAMIC.viewer.addHandler('open-failed', function(e){ + console.error(e.message, e) + redirect($D.pages.table, e.message, 5); + }) // image loaded if (e.hasError) { // if this is a retry, assume normal behavior (one retry per slide) diff --git a/apps/model/model.js b/apps/model/model.js index fdb370bad..99d117f5d 100644 --- a/apps/model/model.js +++ b/apps/model/model.js @@ -404,6 +404,10 @@ function initCore() { } else { $D.params.data = e; } + $CAMIC.viewer.addHandler('open-failed', function(e){ + console.error(e.message, e) + redirect($D.pages.table, e.message, 5); + }) }); $CAMIC.store.getSlide($D.params.slideId).then((response) => { diff --git a/apps/segment/segment.js b/apps/segment/segment.js index 578879d9f..c6bf774de 100644 --- a/apps/segment/segment.js +++ b/apps/segment/segment.js @@ -371,6 +371,10 @@ function initCore() { } else { $D.params.data = e; } + $CAMIC.viewer.addHandler('open-failed', function(e){ + console.error(e.message, e) + redirect($D.pages.table, e.message, 5); + }) }); $CAMIC.viewer.addOnceHandler('open', function(e) { diff --git a/apps/viewer/init.js b/apps/viewer/init.js index c60f45b13..cc08e0b8b 100644 --- a/apps/viewer/init.js +++ b/apps/viewer/init.js @@ -196,8 +196,8 @@ function initCore() { $CAMIC.loadImg(function(e) { $CAMIC.viewer.addHandler('open-failed', function(e){ - console.error(e.message) - alert("failed!") + console.error(e.message, e) + redirect($D.pages.table, e.message, 5); }) // image loaded if (e.hasError) {