[Dbix-class] Catching DBI errors, without eval?

Josef Karthauser joe at tao.org.uk
Sun Nov 12 11:56:58 GMT 2006


Is it possible to catch DBI errors, without having to wrap the code
within eval blocks?

The specific place where I'm experiencing trouble is,

    DELETE FROM contact WHERE ( contactid = ? AND owner = ? ): '1203', '7'
    DBD::mysql::st execute failed: Cannot delete or update a parent row: a
    foreign key constraint fails at
    /usr/local/lib/perl5/site_perl/5.8.8/DBIx/Class/Storage/DBI.pm line 771.

which was generated from an $obj->delete call.

Joe
-- 
Josef Karthauser (joe at tao.org.uk)	       http://www.josef-k.net/
Physics Particle Theory (student)   http://www.pact.cpes.sussex.ac.uk/
================ An eclectic mix of fact and theory. =================
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://jules.scsys.co.uk/pipermail/dbix-class/attachments/20061112/46a399a1/attachment.pgp


More information about the Dbix-class mailing list