Skip to content

Commit

Permalink
tile error trigger redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
birm committed Jan 10, 2024
1 parent 1daf7a0 commit 4cf3b48
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 2 deletions.
4 changes: 4 additions & 0 deletions apps/heatmap/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ function initCore() {

$CAMIC.loadImg(async function(e) {
Loading.open(document.body, `Loading Data ...`);
$CAMIC.viewer.addHandler('open-failed', function(e){

Check failure on line 63 in apps/heatmap/init.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Missing space before opening brace

Check failure on line 63 in apps/heatmap/init.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Missing space before opening brace
console.error(e.message, e)

Check failure on line 64 in apps/heatmap/init.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Missing semicolon

Check failure on line 64 in apps/heatmap/init.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Missing semicolon
redirect($D.pages.table, e.message, 5);
})

Check failure on line 66 in apps/heatmap/init.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Missing semicolon

Check failure on line 66 in apps/heatmap/init.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Missing semicolon
// image loaded
if (e.hasError) {
$UI.message.addError(e.message);
Expand Down
4 changes: 4 additions & 0 deletions apps/labeling/labeling.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ function initCore() {
defaultText: `Slide: ${$D.params.data.name}`,
});
}
$CAMIC.viewer.addHandler('open-failed', function(e){

Check failure on line 80 in apps/labeling/labeling.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Missing space before opening brace

Check failure on line 80 in apps/labeling/labeling.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Missing space before opening brace
console.error(e.message, e)

Check failure on line 81 in apps/labeling/labeling.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Missing semicolon

Check failure on line 81 in apps/labeling/labeling.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Missing semicolon
redirect($D.pages.table, e.message, 5);
})

Check failure on line 83 in apps/labeling/labeling.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Missing semicolon

Check failure on line 83 in apps/labeling/labeling.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Missing semicolon
});

$CAMIC.viewer.addHandler('open', function() {
Expand Down
4 changes: 4 additions & 0 deletions apps/mini/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions apps/model/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,10 @@ function initCore() {
} else {
$D.params.data = e;
}
$CAMIC.viewer.addHandler('open-failed', function(e){

Check failure on line 407 in apps/model/model.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Missing space before opening brace

Check failure on line 407 in apps/model/model.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Missing space before opening brace
console.error(e.message, e)

Check failure on line 408 in apps/model/model.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Missing semicolon

Check failure on line 408 in apps/model/model.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Missing semicolon
redirect($D.pages.table, e.message, 5);
})

Check failure on line 410 in apps/model/model.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Missing semicolon

Check failure on line 410 in apps/model/model.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Missing semicolon
});

$CAMIC.store.getSlide($D.params.slideId).then((response) => {
Expand Down
4 changes: 4 additions & 0 deletions apps/segment/segment.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@ function initCore() {
} else {
$D.params.data = e;
}
$CAMIC.viewer.addHandler('open-failed', function(e){

Check failure on line 374 in apps/segment/segment.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Missing space before opening brace

Check failure on line 374 in apps/segment/segment.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Missing space before opening brace
console.error(e.message, e)
redirect($D.pages.table, e.message, 5);
})
});

$CAMIC.viewer.addOnceHandler('open', function(e) {
Expand Down
4 changes: 2 additions & 2 deletions apps/viewer/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4cf3b48

Please sign in to comment.