X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI.pm;h=3dbfd39719f00af8b3933be92d9bd18fef2fa1f5;hb=b9ca4ff1e045a7863033012e98dc83b5dc95e26e;hp=1bc266ec7f8913a39cdaf445348530d28ae8eec2;hpb=fd323bf1046faa7de5a8c985268d80ec5b703361;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 1bc266e..3dbfd39 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -19,11 +19,11 @@ use Try::Tiny; use File::Path (); use namespace::clean; -__PACKAGE__->mk_group_accessors('simple' => - qw/_connect_info _dbi_connect_info _dbh _sql_maker _sql_maker_opts _conn_pid - _conn_tid transaction_depth _dbh_autocommit _driver_determined savepoints - _server_info_hash/ -); +__PACKAGE__->mk_group_accessors('simple' => qw/ + _connect_info _dbi_connect_info _dbic_connect_attributes _driver_determined + _dbh _server_info_hash _conn_pid _conn_tid _sql_maker _sql_maker_opts + transaction_depth _dbh_autocommit savepoints +/); # the values for these accessors are picked out (and deleted) from # the attribute hashref passed to connect_info @@ -582,6 +582,11 @@ sub connect_info { $self->_dbi_connect_info([@args, %attrs && !(ref $args[0] eq 'CODE') ? \%attrs : ()]); + # FIXME - dirty: + # save attributes them in a separate accessor so they are always + # introspectable, even in case of a CODE $dbhmaker + $self->_dbic_connect_attributes (\%attrs); + return $self->_connect_info; } @@ -1466,7 +1471,9 @@ sub _dbh_execute { # Can this fail without throwing an exception anyways??? my $rv = $sth->execute(); - $self->throw_exception($sth->errstr) if !$rv; + $self->throw_exception( + $sth->errstr || $sth->err || 'Unknown error: execute() returned false, but error flags were not set...' + ) if !$rv; $self->_query_end( $sql, @$bind );