[Catalyst-dev] A suggestion(or question) about exception handling.

Christopher H. Laco claco at chrislaco.com
Wed Jul 23 17:32:45 BST 2008


Kee Hinckley wrote:
> On Jul 21, 2008, at 5:46 PM, Matt S Trout wrote:
>> On Sat, Jul 19, 2008 at 10:16:55PM -0400, Chae Lee wrote:
>>> hi all,
>>>
>>> in my Catalyst application, I'm using my own exception handling based on
>>> "Error.pm", and used to ask myself what if Catalyst provided the =

>>> facility.
>>>
>>> I know there are several ways in error(or exception) handling in =

>>> Perl, but,
>>> anyway my favorite is "try/catch."
>>>
>>> today I saw Catalyst::Exception. It wasn't what I expected.
>>>
>>> so... is there already any extension based on Error.pm in Catalyst OR =

>>> any
>>> plan??
>>
>> Extension for what?
>>
>> There's nothing to stop you using Error.pm in the Catalyst app - I don't
>> really see what Catalyst needs to do about it?
> =

> I use Error extensively in Catalyst, but I understand the problem he =

> raises.  Right now Catalyst traps errors itself Catalyst::execute().  =

> What Chae Lee probably wants (I know I do) is a way to insert an Error =

> handler that traps those errors, or at the very least, uses try/catch so =

> that what gets stored in $c->error are Error objects instead of =

> strings.  You can't fix this with a Plugin because you have no way of =

> knowing when in the process your plugin will be called.  As a result, I =

> tend to end up with actions that look like:


For me, it's wishing for an exception_action just like DBIC has, and way =

I can subvert exceptions at the app leve without tinkering with =

errors/setting/clearing/resetting, etc.

-=3DChris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
Url : http://lists.scsys.co.uk/pipermail/catalyst-dev/attachments/20080723/=
e96e859c/signature.pgp


More information about the Catalyst-dev mailing list