cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From juergen.se...@basf-it-services.com
Subject Re: unroll behavior in the ExceptionSelector
Date Thu, 10 Apr 2003 10:20:39 GMT

Hi Sylvain,

sorry, we didn´t noticed that you use recursion to unroll.
Of course, your solution fits our needs.

We only propose one improvement :-)


      if (cause != null) {
            String name = findName(cause);
            if (name != null){
                  return name;
            }
      }

The result would be, that if you have a cause, that is not configured,
you don´t return null, but the name of the cause's parent, that is
configured.
(Sounds a little bit confusing (-: )

Regards,
Björn and Jürgen




                                                                                         
                                                   
                      Sylvain Wallez                                                     
                                                   
                      <sylvain.wallez@anywar         An:      cocoon-dev@xml.apache.org
                                                     
                      e-tech.com>                    Kopie:   (Blindkopie: Juergen Seitz/BASF-AG/BASF)
                                      
                                                     Thema:   Re: unroll behavior in the ExceptionSelector
                                  
                      10.04.2003 11:03                                                   
                                                   
                      Bitte antworten an                                                 
                                                   
                      cocoon-dev                                                         
                                                   
                                                                                         
                                                   
                                                                                         
                                                   




juergen.seitz@basf-it-services.com wrote:

>Hi,
>
>we propose to change the possible values for attribute "unroll" in the
>configuration entries of the new ExceptionSelector from "true" and "false"
>to "no", "cause" and "rootcause". This would make it possible to not only
>consider a nested exception, but to extract the root exception from
>multi-wrapped exceptions.
>In other words the decision would be to call method getCause() or
>getRootCause() of class ExceptionUtils, that is used inside the selector
>even yet.
>
>Example:
>Imagine we have wrapped exceptions ProcessingException ?
>InvocationTargetException ? NullpointerException. Currently the
>ExceptionSelector is only able to consider the ProcessingException and the
>InvocationTargetException by:
><map:selector name="exception" class="...">
>             <exception name="exc1" class="ProcessingException"/>
>             <exception name="exc2" class="InvocationTargetException"
>unroll="true"/>
></map:selector>
>Our approach would also allow to extract the root cause by:
><map:selector name="exception" class="...">
>             <exception name="exc1" class="ProcessingException"/>
>             <exception name="exc2" class="InvocationTargetException"
>unroll="cause"/>
>             <exception name="exc2" class="NullpointerException" unroll
>="rootcause"/>
></map:selector>
>
>What do you think about such a change, does it make sense?
>

I don't like it much, as the root exception may not have an attached
type definition. In the main Cocoon sitemap, the last configuration item
is :
     <exception class="java.lang.Throwable" unroll="true"/>

This has the effect to unroll exceptions as much as possible until we
find one that has an associated type. That way, you are sure you will
get the type associated to one of the configured exceptions, whatever
its position in the exception chain.

Does this fit your need ?

Sylvain

--
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }








Mime
View raw message