NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
++ to all this (Score:1)
I've used custom exceptions for ResourceNotFound, InvalidIdentifier and such regularly in applications in the past and it worked quite well. I also experimented with an un-auto like catching mechanism. For example, the chain segment Foo::Bar::load would throw an ResourceNotFound::Bar exception if it can't find a bar with the passed ID. It would then search in Foo::Bar, and then in Foo for exception handling actions that fit the criteria (catching ResourceNotFound::Bar, ResourceNotFound or FlowException).
I
Ordinary morality is for ordinary people. -- Aleister Crowley
Re:++ to all this (Score:1)
Great idea! It seems like we're inching towards a more robust idea of exception handling.
Right now I'm pretty happy encapsulating some logic inside each exception class -- though something more closely tied to the application would likely be better in some instances.
Reply to This
Parent