Discussion:
Getting Exception.getMessage in map:handle-errors
Ivan Lagunov
2013-04-17 15:35:38 UTC
Permalink
Hello,



Is it possible to access fields of the thrown Exception inside
map:handle-errors?



I want to do something like this:

<map:handle-errors>

<map:select type="exception">

<map:when test="processing">

<map:generate src="page/exception.jx" type="jx">

<map:parameter name="errorMessage" value="want to extract
Exception.getMessage() here"/>

</map:generate>

<map:serialize type="xhtml"/>

</map:when>

</map:select>

</map:handle-errors>



Where selector is defined as following:

<map:selector name="exception"
src="org.apache.cocoon.selection.ExceptionSelector">

<exception name="processing"
class="org.apache.cocoon.ProcessingException"/>

</map:selector>



Any ideas how to achieve this?



Best regards,

Ivan Lagunov
Jos Snellings
2013-04-17 15:52:28 UTC
Permalink
Hi Ivan,

Please try : jexl:cocoon.exception.messsage

I don't have my cocoon environment handy here, but odds are good that it
works.
Jos
Hello,****
** **
Is it possible to access fields of the thrown Exception inside
map:handle-errors?****
** **
I want to do something like this:****
<map:handle-errors>****
<map:select type="exception">****
<map:when test="processing">****
<map:generate src="page/exception.jx" type="jx">****
<map:parameter name="errorMessage" value="want to extract
Exception.getMessage() here"/>****
</map:generate>****
<map:serialize type="xhtml"/>****
</map:when>****
</map:select>****
</map:handle-errors>****
** **
Where selector is defined as following:****
<map:selector name="exception"
src="org.apache.cocoon.selection.ExceptionSelector">****
<exception name="processing"
class="org.apache.cocoon.ProcessingException"/>****
</map:selector>****
** **
Any ideas how to achieve this?****
** **
Best regards,****
Ivan Lagunov****
** **
** **
--
We should be careful to get out of an experience only the wisdom that is
in it - and stay there, lest we be like the cat that sits down on a hot
stove-lid. She will never sit down on a hot stove-lid again - and that
is well; but also she will never sit down on a cold one any more.
-- Mark Twain
<http://www.brainyquote.com/quotes/quotes/t/thomashobb118630.html>
Loading...