[tor-commits] [atlas/master] Proper error handling and fix code repository in about page

art at torproject.org art at torproject.org
Mon Mar 5 23:12:03 UTC 2012


commit 353adc4b92fceb4f9d361be12e37de0150ad7c95
Author: Arturo Filastò <hellais at gmail.com>
Date:   Mon Mar 5 15:11:44 2012 -0800

    Proper error handling and fix code repository in about page
    
    * Add error handling for NoScript (fix #5316)
    * Point to gitweb.tpo instead of github
---
 js/collections/results.js |   19 ++++++++++++++++++-
 templates/about.html      |    2 +-
 templates/search/do.html  |    4 ++++
 3 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/js/collections/results.js b/js/collections/results.js
index 127ea1e..4b06e95 100644
--- a/js/collections/results.js
+++ b/js/collections/results.js
@@ -49,7 +49,24 @@ define([
                         }
                     });
                 });
-            }).error(function() {console.log("error in doing query..");error(2)});
+            }).error(
+                function(jqXHR, textStatus, errorThrown) {
+                console.log(jqXHR);
+                if(jqXHR.statusText == "error") {
+                    error(2);
+                } else {
+                    error(3);
+                }
+                /*
+                console.log("jqXHR: " +
+                    jqXHR + " textStauts: " +
+                    textStatus + " errorThrown: " +
+                    errorThrown);
+                console.log("error in doing query..");
+                error(2)
+                */
+                }
+            );
         }
 
 	});
diff --git a/templates/about.html b/templates/about.html
index 55003e2..3ae0969 100644
--- a/templates/about.html
+++ b/templates/about.html
@@ -61,7 +61,7 @@ dependencies. <a href="http://jquery.com/">jQuery</a> and <a href="http://docume
 <h2>Open Source</h2>
 <p>
 All the code for this website is Open Source. It actually couldn't be otherwise since it is all being loaded into the browser ;). But it's also released under BSD 2 clause license.
-The sources can be found on <a href="https://github.com/hellais/TorStatus">github</a>
+The sources can be found on <a href="https://gitweb.torproject.org/atlas.git">https://gitweb.torproject.org/atlas.git</a>
 </p>
 </div>
 </div>
diff --git a/templates/search/do.html b/templates/search/do.html
index 8ff2fca..c84ed19 100644
--- a/templates/search/do.html
+++ b/templates/search/do.html
@@ -17,6 +17,10 @@
         <strong>Backend error!</strong><p>The backend server replied with an error
 to your query. This probably means that you did not properly format your query. Or that you just are trying to fuzz my web app hoping to pwn me. Good luck! ;)</p>
     </div>
+    <% } else if (error == 3) {%>
+    <div class="alert alert-error">
+        <strong>JavaScript Error!</strong><p>There is a problem with your javascript environment, you may have noscript enabled on the remote onionoo backend. Try temporarily allowing noscript to connect to the backend IP address. If the problem persits consult <a href="https://trac.torproject.org/">the bugtracker.</a></p>
+    </div>
     <% } %>
 <% } else { %>
 <table cellpadding="0" cellspacing="0" border="0" class="table table-bordered table-striped" id="torstatus_results">



More information about the tor-commits mailing list