comparison lib/js/urweb.js @ 726:6fc633d990e7

onError
author Adam Chlipala <adamc@hcoop.net>
date Thu, 16 Apr 2009 12:36:01 -0400
parents a5d8b470d7ca
children 2197f0e24a9f
comparison
equal deleted inserted replaced
725:4c5796512edc 726:6fc633d990e7
246 throw msg; 246 throw msg;
247 } 247 }
248 248
249 function pf() { 249 function pf() {
250 whine("Pattern match failure"); 250 whine("Pattern match failure");
251 }
252
253 var errorHandlers = null;
254
255 function onError(f) {
256 errorHandlers = cons(f, errorHandlers);
257 }
258
259 function er(s) {
260 for (var ls = errorHandlers; ls; ls = ls.next)
261 ls.data(s)(null);
262 throw s;
251 } 263 }
252 264
253 265
254 // Remote calls 266 // Remote calls
255 267