Patchwork [3,of,3] hgweb: show message when an error occured during ajax loading

login
register
mail settings
Submitter Alexander Plavin
Date Sept. 19, 2013, 12:37 p.m.
Message ID <3f23cc5f52e790d0a02f.1379594260@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/2537/
State Accepted
Headers show

Comments

Alexander Plavin - Sept. 19, 2013, 12:37 p.m.
# HG changeset patch
# User Alexander Plavin <alexander@plav.in>
# Date 1378459858 -14400
#      Fri Sep 06 13:30:58 2013 +0400
# Node ID 3f23cc5f52e790d0a02fda11b0db2998a6ecdf65
# Parent  83b62633254130572dcbe48b094645b67aa5ca20
hgweb: show message when an error occured during ajax loading
Matt Mackall - Sept. 19, 2013, 6:14 p.m.
On Thu, 2013-09-19 at 16:37 +0400, Alexander Plavin wrote:
> # HG changeset patch
> # User Alexander Plavin <alexander@plav.in>
> # Date 1378459858 -14400
> #      Fri Sep 06 13:30:58 2013 +0400
> # Node ID 3f23cc5f52e790d0a02fda11b0db2998a6ecdf65
> # Parent  83b62633254130572dcbe48b094645b67aa5ca20
> hgweb: show message when an error occured during ajax loading

These are queued for default, thanks.

Patch

diff -r 83b626332541 -r 3f23cc5f52e7 mercurial/templates/static/mercurial.js
--- a/mercurial/templates/static/mercurial.js	Fri Sep 06 13:30:58 2013 +0400
+++ b/mercurial/templates/static/mercurial.js	Fri Sep 06 13:30:58 2013 +0400
@@ -366,6 +366,7 @@ 
 
         if (scrollHeight - (scrollTop + clientHeight) < 50) {
             updateInitiated = true;
+            removeByClassName('scroll-loading-error');
 
             if (!nextHash) {
                 var message = {
@@ -400,6 +401,11 @@ 
                     process_dates();
                 },
                 function onerror(errorText) {
+                    var message = {
+                        class: 'scroll-loading-error',
+                        text: 'Error: ' + errorText
+                    };
+                    appendFormatHTML(container, messageFormat, message);
                 },
                 function oncomplete() {
                     removeByClassName('scroll-loading');