[Bast-commits] r5367 - DBIx-Class/0.08/branches/stopgap/lib/DBIx/Class/Storage

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Thu Jan 29 09:08:54 GMT 2009


Author: ribasushi
Date: 2009-01-29 09:08:51 +0000 (Thu, 29 Jan 2009)
New Revision: 5367

Modified:
   DBIx-Class/0.08/branches/stopgap/lib/DBIx/Class/Storage/DBI.pm
Log:
port r5016: Fix an obscure bug in the DBI exception handler, clobbering the exception contents when the same  is used outside of dbic code

Modified: DBIx-Class/0.08/branches/stopgap/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/branches/stopgap/lib/DBIx/Class/Storage/DBI.pm	2009-01-29 09:06:54 UTC (rev 5366)
+++ DBIx-Class/0.08/branches/stopgap/lib/DBIx/Class/Storage/DBI.pm	2009-01-29 09:08:51 UTC (rev 5367)
@@ -6,6 +6,7 @@
 use strict;    
 use warnings;
 use DBI;
+use Carp;
 use SQL::Abstract::Limit;
 use DBIx::Class::Storage::DBI::Cursor;
 use DBIx::Class::Storage::Statistics;
@@ -843,7 +844,12 @@
       my $weak_self = $self;
       weaken($weak_self);
       $dbh->{HandleError} = sub {
-          $weak_self->throw_exception("DBI Exception: $_[0]")
+          if ($weak_self) {
+            $weak_self->throw_exception("DBI Exception: $_[0]");
+          }
+          else {
+            croak ("DBI Exception: $_[0]");
+          }
       };
       $dbh->{ShowErrorStatement} = 1;
       $dbh->{RaiseError} = 1;




More information about the Bast-commits mailing list