You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ralph Goers <Ra...@digitalinsight.com> on 2003/12/11 23:01:19 UTC

[Authentication Framework] handle-errors

I'm using 2.1.3.

My authentication pipeline calls a generator which in turn calls JAAS.  When
login fails I'd like to catch the LoginException using handle-errors in the
sitemap.  Although I don't get any errors I never see the error handling
happen.  Is handle-errors supported in that context?

Ralph Goers


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [Authentication Framework] handle-errors

Posted by Tony Collen <co...@umn.edu>.
Ralph Goers wrote:

> I'm using 2.1.3.
> 
> My authentication pipeline calls a generator which in turn calls JAAS.  When
> login fails I'd like to catch the LoginException using handle-errors in the
> sitemap.  Although I don't get any errors I never see the error handling
> happen.  Is handle-errors supported in that context?

If you're not seeing a stacktrace on the LoginException (i.e. it is not 
being propagated all the way to the top), you might have to catch it in 
your generator and then re-throw it from generate(), which should allow 
the ExceptionSelector to see it:

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

      <exception
        class="org.whatever.LoginException"
        name="invalid-login"/>
   </map:selector>


If you wanted to get fancy, you could catch the LoginException and throw 
your own custom Exception from your generator, and tell the 
ExceptionSelector about the new one.

> 
> Ralph Goers


Regards,

Tony


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org