diff lib/js/urweb.js @ 798:83875a9eb9b8

Improvements while working on Graftid
author Adam Chlipala <adamc@hcoop.net>
date Thu, 14 May 2009 10:31:11 -0400
parents 2c463eee89fa
children e92cfac1608f
line wrap: on
line diff
--- a/lib/js/urweb.js	Thu May 14 09:33:48 2009 -0400
+++ b/lib/js/urweb.js	Thu May 14 10:31:11 2009 -0400
@@ -34,7 +34,9 @@
   whine("Pattern match failure");
 }
 
-function runHandlers(ls, arg) {
+function runHandlers(kind, ls, arg) {
+  if (ls == null)
+    alert(kind + ": " + arg);
   for (; ls; ls = ls.next)
     try {
       ls.data(arg)(null);
@@ -48,7 +50,7 @@
 }
 
 function er(s) {
-  runHandlers(errorHandlers, s);
+  runHandlers("Error", errorHandlers, s);
   throw {uw_error: s};
 }
 
@@ -61,7 +63,7 @@
 function doExn(v) {
   if (v == null || v.uw_error == null) {
     var s = (v == null ? "null" : v.toString());
-    runHandlers(failHandlers, s);
+    runHandlers("Fail", failHandlers, s);
   }
 }
 
@@ -72,7 +74,7 @@
 }
 
 function discon() {
-  runHandlers(disconnectHandlers, null);
+  runHandlers("Disconnect", disconnectHandlers, null);
 }
 
 var connectHandlers = null;
@@ -82,7 +84,7 @@
 }
 
 function conn() {
-  runHandlers(connectHandlers, null);
+  runHandlers("Connect", connectHandlers, null);
 }
 
 var serverHandlers = null;
@@ -92,7 +94,7 @@
 }
 
 function servErr(s) {
-  runHandlers(serverHandlers, s);
+  runHandlers("Server", serverHandlers, s);
 }