[PATCH 6 of 9 V2] hgweb: show message when an error occured during ajax loading

Alexander Plavin alexander at plav.in
Sat Aug 17 17:33:11 CDT 2013


# HG changeset patch
# User Alexander Plavin <alexander at plav.in>
# Date 1376765419 -14400
#      Sat Aug 17 22:50:19 2013 +0400
# Node ID 42fb641c0308be5eb27f298619e787a9d0ac20f8
# Parent  8bea23e0f3b00c7ca8582c6f2970adabc6dab2d1
hgweb: show message when an error occured during ajax loading

diff -r 8bea23e0f3b0 -r 42fb641c0308 mercurial/templates/static/mercurial.js
--- a/mercurial/templates/static/mercurial.js	Sat Aug 17 22:44:31 2013 +0400
+++ b/mercurial/templates/static/mercurial.js	Sat Aug 17 22:50:19 2013 +0400
@@ -367,6 +367,7 @@
         if (scrollHeight - (scrollTop + clientHeight) < 50) {
             updateInitiated = true;
             container.lastElementChild.classList.add('scroll-separator');
+            removeByClassName('scroll-loading-error');
 
             if (!nextHash) {
                 var message = {
@@ -399,6 +400,11 @@
                     process_dates();
                 },
                 function onerror(errorText) {
+                    var message = {
+                        class: 'scroll-loading-error',
+                        text: 'Error: ' + errorText
+                    };
+                    appendFormatHTML(container, messageFormat, message);
                 },
                 function oncomplete() {
                     removeByClassName('scroll-loading');


More information about the Mercurial-devel mailing list