From b6c1b15d74dcf84fdb174eecc31cdf64a98f07a3 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 14 May 2009 10:31:11 -0400 Subject: Improvements while working on Graftid --- lib/js/urweb.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lib') 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); } -- cgit v1.2.3