diff options
author | 2009-04-16 12:36:01 -0400 | |
---|---|---|
committer | 2009-04-16 12:36:01 -0400 | |
commit | 237c9393b135b40e07f97b00699fd6cf9b48dac4 (patch) | |
tree | e5b913873d3ffcd5abcc024dbc7d74e8d1c2aad2 /lib/js/urweb.js | |
parent | 9ac7c1a3cfcd247d5f6313b0e122049ec0b98fe5 (diff) |
onError
Diffstat (limited to 'lib/js/urweb.js')
-rw-r--r-- | lib/js/urweb.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 5ff5b9fb..5cf159ad 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -250,6 +250,18 @@ function pf() { whine("Pattern match failure"); } +var errorHandlers = null; + +function onError(f) { + errorHandlers = cons(f, errorHandlers); +} + +function er(s) { + for (var ls = errorHandlers; ls; ls = ls.next) + ls.data(s)(null); + throw s; +} + // Remote calls |