Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Forgetfulness and 6-months-from-now-you

by oakbox (Chaplain)
on Jan 15, 2018 at 11:04 UTC ( [id://1207271]=note: print w/replies, xml ) Need Help??


in reply to Re: Forgetfulness and 6-months-from-now-you
in thread Forgetfulness and 6-months-from-now-you

I don't take it the wrong way :)

Most of my work is generating content for an API, which wants specifically formatted error handling (which I conveniently left out of my post). I want to die in a clean, and parse-able, way so that the programmer on the other end can either a) figure out what they did wrong or b) communicate with me effectively about what happened. I also use a lot of Mark Overmeer's excellent Log::Report module to make sane logs for internal analysis.

I COULD override die, I guess, and generate something that way. But my laziness doesn't extend that far.

  • Comment on Re^2: Forgetfulness and 6-months-from-now-you

Replies are listed 'Best First'.
Re^3: Forgetfulness and 6-months-from-now-you
by afoken (Chancellor) on Jan 16, 2018 at 20:43 UTC
    I COULD override die, I guess, and generate something that way. But my laziness doesn't extend that far.

    I would probably be that lazy:

    my $dbh=DBI->connect(..., {RaiseError => 1}); # later: if (eval { # use $dbh # perhaps the entire API handling 1; }) { # report success to the API } else { my $error=$@; # Post-Process $error if needed # report $error to the API }

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1207271]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-03-29 15:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found