diff options
author | Yorhel <git@yorhel.nl> | 2017-12-15 17:34:54 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2017-12-15 17:34:57 +0100 |
commit | fa4380844e137905016f5e6cf4a664aae9624a8e (patch) | |
tree | f21c18e619b6aa1f708b20b30c23036bcd6a8313 /lib | |
parent | 0d2ce1dc3e9b8c49fb16e6d68971c81233a4c557 (diff) |
Fix handling of DBD drivers that don't set ParamValues
Such as DBD::SQLite. Which is quite a pity, because param logging is
pretty damn useful. I'll see if it's easy to write a workaround for.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/TUWF/DB.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/TUWF/DB.pm b/lib/TUWF/DB.pm index d140f86..14bfb17 100644 --- a/lib/TUWF/DB.pm +++ b/lib/TUWF/DB.pm @@ -137,7 +137,7 @@ sub sqlhelper { # type, query, @list }; # re-throw the error in the context of the calling code - croak $self->dbh->errstr if !$ret; + croak($self->dbh->errstr || $@) if !$ret; $r = 0 if $type == 0 && (!$r || $r == 0); $r = {} if $type == 1 && (!$r || ref($r) ne 'HASH'); @@ -219,7 +219,7 @@ sub inject_logging { if($self->{Database}{private_tuwf}) { my $time = time - $start; - my %params = %{$self->{ParamValues}}; + my %params = %{$self->{ParamValues} || {}}; $TUWF::OBJ->log(sprintf '[%7.2fms] %s | %s', |