diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/js/urweb.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 5482c2a5..2943c897 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -34,7 +34,9 @@ function pf() { 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 onError(f) { } function er(s) { - runHandlers(errorHandlers, s); + runHandlers("Error", errorHandlers, s); throw {uw_error: s}; } @@ -61,7 +63,7 @@ function onFail(f) { 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 onDisconnect(f) { } function discon() { - runHandlers(disconnectHandlers, null); + runHandlers("Disconnect", disconnectHandlers, null); } var connectHandlers = null; @@ -82,7 +84,7 @@ function onConnectFail(f) { } function conn() { - runHandlers(connectHandlers, null); + runHandlers("Connect", connectHandlers, null); } var serverHandlers = null; @@ -92,7 +94,7 @@ function onServerError(f) { } function servErr(s) { - runHandlers(serverHandlers, s); + runHandlers("Server", serverHandlers, s); } |