On Sat, 26 May 2007, Ian Burrell wrote:

> Would anyone be interested in a sub-class of HTML::Mason::Request that
> calls an optional error_sub subref on fatal errors?  That is what I
> ended up writing to handle our custom error handling.  Our live site
> displays a simple page to the users and send the developers the error
> message.  The sub-class adds error_sub slot.  It calls the subref if
> the error_mode is 'fatal' and the error_sub exists.  If people were
> interested, I could turn it into a MasonX class on CPAN.
>
> Would that functionality make sense in the base-class?

This might be the same thing I just added to the Request class for the 
next release:


=item component_error_handler

A code reference used to handle errors thrown during component
compilation or runtime. By default, this is a subroutine that turns
non-exception object errors in components into exceptions. If this
parameter is set to a false value, these errors are simply rethrown
as-is.

Turning exceptions into objects can be expensive, since this will
cause the generation of a stack trace for each error. If you are using
strings or unblessed references as exceptions in your code, you may
want to turn this off as a performance boost.



-dave

/*===================================================
VegGuide.Org                        www.BookIRead.com
Your guide to all that's veg.       My book blog
===================================================*/

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to