On 12 Jan 2004, at 16:35, Christopher Oliver wrote:
Sylvain Wallez wrote:
Christopher Oliver wrote:
I started looking into how I could get a meaningful stack trace (with location information) spanning (possibly nested) invocations of the sitemap, flowscript, and JXTemplateGenerator.
<snip>
WDYT?
/me thinks it's great!
Some low-level remarks, however:
- we need a "popStackFrame()" method, since once a component has been executed successfully and execution continues in its following siblings, it should no longer appear in the stack trace
The idea is that this stack trace is created during exception processing:
try {
do whatever
} catch (Exception e) {
Cocoon.addCocoonStackTrace("failed to do whatever", "comp", "method", uri, line, column);
throw e;
}
Thus, during normal processing there is no overhead. That's why there's no popStackFrame().
I like this approach.
- is the "message" parameter really needed? It's only meaningful for the statement where the error occured, and will be present in the Java exception that is raised.
I guess you're right, but my thinking was that additional information about the call site could be useful. If there's no additional information you can just pass null.
There might be cases where from a SAXException it could look like a "element could get a closing tag" while from a sitemap perspective it could look like "xml document is not wellformed".
Having a bigger context could yield more semantically meaningful error messages and this is very valuable IMO.
-- Stefano.
