From 5df61d42d01c2857264748cc6c871491ac3ae79c Mon Sep 17 00:00:00 2001 From: Alvaro Lobato Date: Tue, 15 Nov 2016 15:50:02 +0100 Subject: [PATCH] [JENKINS-39741] - Redirect to login page after authorisation error when checking connectivity to update center and handle any other error. --- war/src/main/js/util/jenkins.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/war/src/main/js/util/jenkins.js b/war/src/main/js/util/jenkins.js index 6b31f42681..43c031fe33 100644 --- a/war/src/main/js/util/jenkins.js +++ b/war/src/main/js/util/jenkins.js @@ -244,7 +244,14 @@ exports.testConnectivity = function(siteId, handler) { handler(true); } } - }); + }, { error: function(xhr, textStatus, errorThrown) { + if (xhr.status === 403) { + exports.goTo('/login'); + } else { + handler.call({ isError: true, errorMessage: errorThrown }); + } + } + }); }; testConnectivity(); }; -- GitLab