Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Re: Re: What Are The Rules For Subs And Modules When Fed Wrong Input

by gav^ (Curate)
on Jul 22, 2002 at 02:03 UTC ( #183916=note: print w/replies, xml ) Need Help??


in reply to Re: Re: What Are The Rules For Subs And Modules When Fed Wrong Input
in thread What Are The Rules For Subs And Modules When Fed Wrong Input

If the DBI module threw useful exceptions when things went wrong, I would no longer have to sit there checking the return on every little operation to make sure things went ok. I could wrap my entire atomic operation in an eval {}, catch any exceptions I found relevant and re-start the entire operation or provide *useful* input to the user if necessary.
Strangely enough you can do that. It's just a matter of reading through the documentation (1.30 here, 1.19 here).

You can use the RaiseError, PrintError (and on later DBI versions) HandleError database handles to pull this off. If you download Tim Bunce's Advanced Perl DBI slides there is more information.

Hope this helps...

gav^

  • Comment on Re: Re: Re: What Are The Rules For Subs And Modules When Fed Wrong Input

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://183916]
help
Chatterbox?
[erix]: and my solfège is a little rusty too
[stonecolddevin]: damn where's a working cblast? looks like several of them are out of commission
[erix]: Tanktalus home node has one
[stonecolddevin]: erix thanks mate
[stonecolddevin]: also lol @ "I stomped a crap"
[stonecolddevin]: Disciplus i was just amazed he's returned after the thorough stomp that BrowserUk and several other monks gave him for spreading crap info
[stonecolddevin]: i will admit i find the responses to his threads incredibly entertaining

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2017-06-22 20:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (529 votes). Check out past polls.