Hi,
for a customer we need two extensions to the current error handling in
Cocoon. Since we think, that this extensions may be of general interest in
Cocoon, we'd like to ask what you think about it? Thanks for answers!
1) Possibility to define a "hierarchy" of error handlers: pipeline -
subsitemap - sitemap. The behaviour is expected to be the following: When an
exception occurs, Cocoon shall check whether a handler has been defined for
the requested resource's pipeline, that is able to handle this specific
error. If such a handler does not exist, a handler responsible for the whole
subsitemap is searched. If it also does not exists, an over-all default
handler, defined in the root sitemap, would be used.
Our idea now is to extend the tag for being able to contain
tags and add the above behaviour to the treeprocessor.
This allows handler's to be defined for the hierarchy levels subsitemap and
sitemap:
Sitemap:
...
...
Subsitemap:
...
...
...
...
2) Each error handler shall not only regard the type of the occured
exception for the decision, whether he is responsible for it, but further
properties like error codes etc., that are accessible via bean-style methods
in the exception object.
Our idea for this is to extend the new
org.apache.cocoon.selection.ExceptionSelector, so that an error handler
definition could look like:
...
...
In this case the exception classes example.MyException1 and
example.MyException2 are expected to have a method getErrorCode() which is
called via reflection from within the selector.
One could also think about allowing more complex expression within the test
attribute like (type=myexc1 and errorCode>=10 and errorCode<20) etc.
Any comments?
Regards, Bjoern.
--------------------------------------------
S&N AG
Klingender Str. 5
D-33100 Paderborn
--------------------------------------------
internet: http://www.s-und-n.de
mail: bluetkemeier@s-und-n.de
phone: 05251 / 1581-35
--------------------------------------------