From 1ec4d71db09b692c5f86237d96585474e9c41b73 Mon Sep 17 00:00:00 2001 From: Jirka Date: Thu, 7 Apr 2022 17:56:14 +0200 Subject: [PATCH] makeAjaxRequest(): delegate error message responsibility to the handler if any. --- src/imageloader.js | 2 +- src/openseadragon.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/imageloader.js b/src/imageloader.js index 198882b6..ac36d47a 100644 --- a/src/imageloader.js +++ b/src/imageloader.js @@ -130,7 +130,7 @@ ImageJob.prototype = { self.image.src = url; }, error: function(request) { - self.errorMsg = "Image load aborted - XHR error"; + self.errorMsg = "Image load aborted - XHR error: Ajax returned " + request.status; self.finish(false); } }); diff --git a/src/openseadragon.js b/src/openseadragon.js index 731a06b4..c06a9f56 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -2364,10 +2364,10 @@ function OpenSeadragon( options ){ protocol !== "https:" )) { onSuccess( request ); } else { - $.console.error( "AJAX request returned %d: %s", request.status, url ); - if ( $.isFunction( onError ) ) { onError( request ); + } else { + $.console.error( "AJAX request returned %d: %s", request.status, url ); } } }