diff piecrust/resources/server/piecrust-debug-info.js @ 1082:8d5b8a3dca02

serve: Show debug info, report errors when debug info isn't available.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 15 Feb 2018 21:17:01 -0800
parents 93b656f0af54
children
line wrap: on
line diff
--- a/piecrust/resources/server/piecrust-debug-info.js	Thu Feb 15 21:16:10 2018 -0800
+++ b/piecrust/resources/server/piecrust-debug-info.js	Thu Feb 15 21:17:01 2018 -0800
@@ -284,13 +284,11 @@
     xmlHttp.onreadystatechange = function() {
         if (xmlHttp.readyState == XMLHttpRequest.DONE) {
             var info = document.querySelector('.piecrust-debug-info');
-            if(xmlHttp.status == 200) {
+            if(xmlHttp.status < 500) {
                 info.innerHTML = xmlHttp.responseText;
             }
-            else if(xmlHttp.status == 400) {
-                info.innerHTML = "Error fetching debug info.";
-            }
             else {
+                console.log(xmlHttp);
                 info.innerHTML = "Unknown error.";
             }
         }