[Bast-commits] r3515 - in trunk/DBIx-Class: . lib/DBIx/Class/Storage

matthewt at dev.catalyst.perl.org matthewt at dev.catalyst.perl.org
Wed Jun 20 05:00:05 GMT 2007


Author: matthewt
Date: 2007-06-20 05:00:03 +0100 (Wed, 20 Jun 2007)
New Revision: 3515

Modified:
   trunk/DBIx-Class/Changes
   trunk/DBIx-Class/lib/DBIx/Class/Storage/DBI.pm
Log:
SQL statement in errors

Modified: trunk/DBIx-Class/Changes
===================================================================
--- trunk/DBIx-Class/Changes	2007-06-20 03:57:08 UTC (rev 3514)
+++ trunk/DBIx-Class/Changes	2007-06-20 04:00:03 UTC (rev 3515)
@@ -1,5 +1,7 @@
 Revision history for DBIx::Class
 
+        - more expressive DBI errors
+        - soften errors during deploy
         - ensure_connected before txn_begin to catch stomping on transaction
           depth
         - new method "rethrow" for our exception objects

Modified: trunk/DBIx-Class/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- trunk/DBIx-Class/lib/DBIx/Class/Storage/DBI.pm	2007-06-20 03:57:08 UTC (rev 3514)
+++ trunk/DBIx-Class/lib/DBIx/Class/Storage/DBI.pm	2007-06-20 04:00:03 UTC (rev 3515)
@@ -382,15 +382,14 @@
 =item unsafe
 
 This Storage driver normally installs its own C<HandleError>, sets
-C<RaiseError> on, and sets C<PrintError> off on all database handles,
-including those supplied by a coderef.  It does this so that it can
-have consistent and useful error behavior.
+C<RaiseError> and C<ShowErrorStatement> on, and sets C<PrintError> off on
+all database handles, including those supplied by a coderef.  It does this
+so that it can have consistent and useful error behavior.
 
 If you set this option to a true value, Storage will not do its usual
-modifications to the database handle's C<RaiseError>, C<PrintError>, and
-C<HandleError> attributes, and instead relies on the settings in your
-connect_info DBI options (or the values you set in your connection
-coderef, in the case that you are connecting via coderef).
+modifications to the database handle's attributes, and instead relies on
+the settings in your connect_info DBI options (or the values you set in
+your connection coderef, in the case that you are connecting via coderef).
 
 Note that your custom settings can cause Storage to malfunction,
 especially if you set a C<HandleError> handler that suppresses exceptions
@@ -772,6 +771,7 @@
       $dbh->{HandleError} = sub {
           $weak_self->throw_exception("DBI Exception: $_[0]")
       };
+      $dbh->{ShowErrorStatement} = 1;
       $dbh->{RaiseError} = 1;
       $dbh->{PrintError} = 0;
     }




More information about the Bast-commits mailing list