From cb49e19e9ed2e90a4ece7a5479a4f6e3d342925f Mon Sep 17 00:00:00 2001 From: Gerhard Killesreiter Date: Tue, 28 Mar 2006 09:29:23 +0000 Subject: #54003, Watchdog not logging update errors, patch by Steven --- misc/progress.js | 2 +- misc/update.js | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'misc') diff --git a/misc/progress.js b/misc/progress.js index cc029e5b5..b519f066b 100644 --- a/misc/progress.js +++ b/misc/progress.js @@ -107,7 +107,7 @@ progressBar.prototype.receivePing = function (string, xmlhttp, pb) { progressBar.prototype.displayError = function (string) { var error = document.createElement('div'); error.className = 'error'; - error.appendChild(document.createTextNode(string)); + error.innerHTML = string; this.element.style.display = 'none'; this.element.parentNode.insertBefore(error, this.element); diff --git a/misc/update.js b/misc/update.js index 1dbfdb10e..9177296a1 100644 --- a/misc/update.js +++ b/misc/update.js @@ -7,15 +7,21 @@ if (isJsEnabled()) { } if ($('progress')) { - updateCallback = function (progress, status, pb) { + // Success: redirect to the summary. + var updateCallback = function (progress, status, pb) { if (progress == 100) { pb.stopMonitoring(); window.location = window.location.href.split('op=')[0] +'op=finished'; } } - errorCallback = function (pb) { - window.location = window.location.href.split('op=')[0] +'op=error'; + // Failure: point out error message and provide link to the summary. + var errorCallback = function (pb) { + var div = document.createElement('p'); + div.className = 'error'; + div.innerHTML = 'An unrecoverable error has occured. You can find the error message below. It is advised to copy it to the clipboard for reference. Please continue to the update summary'; + $('progress').insertBefore(div, $('progress').firstChild); + $('wait').style.display = 'none'; } var progress = new progressBar('updateprogress', updateCallback, HTTPPost, errorCallback); -- cgit v1.2.3