Author: timbo
Date: Mon Jan  2 05:59:32 2012
New Revision: 15057

Modified:
   dbi/trunk/lib/DBD/Gofer.pm

Log:
Fixed Gofer error handling for keeperr methods like ping

Modified: dbi/trunk/lib/DBD/Gofer.pm
==============================================================================
--- dbi/trunk/lib/DBD/Gofer.pm  (original)
+++ dbi/trunk/lib/DBD/Gofer.pm  Mon Jan  2 05:59:32 2012
@@ -97,7 +97,12 @@
         if (my $warnings = $response->warnings) {
             warn $_ for @$warnings;
         }
-        return $h->set_err($response->err_errstr_state);
+        my ($err, $errstr, $state) = $response->err_errstr_state;
+        # Only set_err() if there's an error else leave the current values
+        # (The current values will normally be set undef by the DBI dispatcher
+        # except for methods marked KEEPERR such as ping.)
+        $h->set_err($err, $errstr, $state) if defined $err;
+        return undef;
     }
 
 

Reply via email to