Vadim Gritsenko wrote:
Sylvain Wallez wrote:
Vadim Gritsenko wrote:
<map:pipeline internal-error-handling="true">
Or even better, let's put this information on the handle-error statement itself, because it's really where it belongs:
Only problem I see with it is that it opens up a scenario:
<map:pipeline> ... <map:handle-errors when="internal"> ... </map:handle-errors> <map:handle-errors when="external"> ... </map:handle-errors> </map:pipeline>
And I'm not sure we want to go there. Hence, attribute on the pipeline itself is better, IMHO. It indicates that this is a feature of the pipeline (similar to internal-only="true").
The easy solution is to consider that there can be only one <map:handle-errors> per <map:pipeline>! Currently, and for historical reasons, there can be a combination of either :
<map:handle-errors> where the handler will need to have its own generator
or
<map:handle-errors type="404">
<map:handle-errors type="500">
where the ErrorGenerator is automatically added.
The second form can be considered to be a deprecated legacy feature (need to add logs for it, BTW), and we can therefore safely put the "when" attribute on the first form (with no "type" attribute).
OTOH, using handle-errors attribute allows for: <map:pipelines> <map:pipeline> ... </map:pipeline> <map:handle-errors when="always"> ... </map:handle-errors> </map:pipeline>
Which otherwise would require attribute on map:pipelines, if that feature is needed at all.
Yep. And that shows that it's really a feature of <handle-errors> and not of <pipeline>.
<map:handle-errors when="external|internal|always">
Isn't <map:handle-errors when="internal"> FS? What would be the scenario for having error handler for internal but not external requests?
Maybe a scenario where you want to have errors be handled by the servlet engine?
When attribute is missing or set to false, error handling behaviour is as it is currently. Limitation of current implementation of the feature is that only one, the inner most one error handler will be used for error handling. Implementation can be extended to support hierarchical error handlers, but I followed KISS and YAGNI approaches.
Internal requests have the problem that pipeline execution occurs out of the control of the sitemap engine. Does the above restriction apply to pipeline build-time or pipeline execution-time?
Yes, good catch. I implemented single error handler for pipeline processing time. Pipeline assembly stage can use hierarchical handlers.
Ok, cool.
Sylvain
-- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
