Suppressing exception-suppressing

0 views
Skip to first unread message

Michael Mahemoff

unread,
Oct 25, 2009, 7:17:02 PM10/25/09
to tiddly...@googlegroups.com
When macros go wrong, tiddlywiki shows "Error in macro foo". Is there
a way to make it not do this, so the error bubbles up to the (Firebug)
console as with normal Javascript errors.

Likewise for plugin evaluation?

Eric Shulman

unread,
Oct 26, 2009, 12:47:50 AM10/26/09
to TiddlyWikiDev
For macros, you could simplify the core's invokeMacro() function to
leave out the error checks and try{...}catch(e){...} handling, like
this:

---------------------------
function invokeMacro(place,macro,params,wikifier,tiddler) {
var m = config.macros[macro];
var tiddlerElem=story.findContainingTiddler(place);
window.tiddler=tiddlerElem?store.getTiddler(tiddlerElem.getAttribute
("tiddler")):null;
window.place = place;
m.handler(place,macro,params.readMacroParams
(),wikifier,params,tiddler);
}
---------------------------

If m is null, or m.handler is undefined, or the m.handler throws an
error when invoked, then that error will no longer be caught and
should propagate all the way out the the debugger.

enjoy,
-e
Reply all
Reply to author
Forward
0 new messages