Just something I've been working on recently. Previously I would check the result of every DBI statement with RaiseError set and an eval around each statement:
The evals added a lot of repetitive code. DBI database handles have an attribute called HandleError that allows a subroutine to be run when an error is encountered. The code is much cleaner with rollback and confess in the HandleError subroutine.
Also if something different needs to be done with errors for a specific statement the HandleError subroutine can be disabled temporarily by saving it to a temporary variable, setting HandleError to undef, then setting HandleError back to the temporary variable later.
ikaika (ee-KYE-kah): Strong, powerful, sturdy, stalwart; strength, force, energy, might.
Subscribe to:
Post Comments (Atom)
PreferenceKey Quirks
PreferenceKey has a few quirks that have tripped me up. One is the reduce(value:nextValue:) implementation. The other is that a PreferenceKe...

-
I've been working on a WPF project in Visual Studio 2010 and I came across a problem where Visual Studio would crash when I used the Doc...
-
I've finally had some free time to work on the Label Sphere. The new version should correctly color the labels according to your blog...
-
My first Google Gadget is at the top of the left column of my blog. I've seen label clouds around and they all used flash so I decided ...
No comments:
Post a Comment