Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
The stupid question is the question not asked
 
PerlMonks  

Re: Use of "die" in OO modules

by kyle (Abbot)
on Jan 18, 2007 at 14:14 UTC ( [id://595320]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Use of "die" in OO modules

I like to use Exception::Class to throw exceptions. If the caller wants to ignore my gravely important problems, it will have to do that explicitly. It's nice to have a module that contains all the exceptions I'll want to throw. It looks like:

package My::Exceptions; use Exception::Class ( 'My::Bad' => { description => 'Way bad', }, 'My::OtherBad' => { description => 'Bad as well', isa => 'My::Bad', }, ); 1;

Then anywhere I need them, just use My::Exceptions and My::Bad->throw( error => 'Woe is me' ).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://595320]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.