Hi,
Just to let you know that I have started implementing error handling
in the new rendering. Right now my idea is to wrap macro errors (macro
not found, macro execution error) in an ErrorBlock so that renderers
can decide to display them as they want.
Something like the following (note: I think I need to add another <!--
errordescription:(description)--> comment for putting error
description (like the staktrace) in addition to the short error message.
.#-----------------------------------------------------
.input|xwiki/2.0
.# Verify behavior when macro doesn't exist
.#-----------------------------------------------------
Unknown {{unknown/}} macro
.#-----------------------------------------------------
.expect|event
.#-----------------------------------------------------
beginDocument
beginParagraph
onWord [Unknown]
onSpace
beginError: [Unknown macro: unknown]
onMacroInline [unknown] [] []
endError: [Unknown macro: unknown]
onSpace
onWord [macro]
endParagraph
endDocument
.#-----------------------------------------------------
.expect|xhtml
.#-----------------------------------------------------
<p>Unknown <!--starterror:Unknown macro: unknown--><!--
startmacro:unknown|-||-|--><!--stopmacro--><!--stoperror-->
macro</p>
.#-----------------------------------------------------
.expect|xwiki
.#-----------------------------------------------------
Unknown {{unknown/}} macro
.#-----------------------------------------------------
.input|xhtml/1.0
.#-----------------------------------------------------
<html><p>Unknown <!--starterror:Unknown macro: unknown--><!--
startmacro:unknown|-||-|--><!--stopmacro--><!--stoperror-->
macro</p></
html>
I still haven't decided if MacroTransformation should still raise
exceptions or not. I'm also investigating how to handle other
rendering errors but my idea is also to wrap them in error blocks.
Let me know what you think and respond quickly if you don't agree with
this since I'm progressing fast on it.
Thanks
-Vincent