diff options
Diffstat (limited to 'misc/update.js')
-rw-r--r-- | misc/update.js | 12 |
1 files changed, 9 insertions, 3 deletions
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 <a href="update.php?op=error">update summary</a>'; + $('progress').insertBefore(div, $('progress').firstChild); + $('wait').style.display = 'none'; } var progress = new progressBar('updateprogress', updateCallback, HTTPPost, errorCallback); |