From: Matt S Trout Date: Wed, 20 Jun 2007 04:00:03 +0000 (+0000) Subject: SQL statement in errors X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2ab60eb9452d546818fe8a20e58e9d19c8379272;p=dbsrgits%2FDBIx-Class-Historic.git SQL statement in errors --- diff --git a/Changes b/Changes index e82e213..b1c67ad 100644 --- a/Changes +++ b/Changes @@ -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 diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 7251ccf..ab28f83 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -382,15 +382,14 @@ each other. In most cases this is simply a C<.>. =item unsafe This Storage driver normally installs its own C, sets -C on, and sets C 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 and C on, and sets C 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, C, and -C 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 handler that suppresses exceptions @@ -772,6 +771,7 @@ sub _connect { $dbh->{HandleError} = sub { $weak_self->throw_exception("DBI Exception: $_[0]") }; + $dbh->{ShowErrorStatement} = 1; $dbh->{RaiseError} = 1; $dbh->{PrintError} = 0; }