Author: timbo
Date: Wed Aug 15 09:23:37 2007
New Revision: 9838

Modified:
   dbi/trunk/DBI.xs
   dbi/trunk/lib/DBI/Gofer/Execute.pm

Log:
tweak eror messages


Modified: dbi/trunk/DBI.xs
==============================================================================
--- dbi/trunk/DBI.xs    (original)
+++ dbi/trunk/DBI.xs    Wed Aug 15 09:23:37 2007
@@ -2586,7 +2586,7 @@
     }
 
     if (!SvROK(increment) || SvTYPE(SvRV(increment)) != SVt_PVAV)
-       croak("dbi_profile_merge_nodes: increment not an array or hash ref");
+       croak("dbi_profile_merge_nodes: increment %s not an array or hash ref", 
neatsvpv(increment,0));
     i_av = (AV*)SvRV(increment);
 
     tmp = *av_fetch(d_av, DBIprof_COUNT, 1);
@@ -4193,7 +4193,7 @@
     CODE:
     {
        if (!SvROK(dest) || SvTYPE(SvRV(dest)) != SVt_PVAV)
-           croak("dbi_profile_merge_nodes(%s,...) not an array reference", 
neatsvpv(dest,0));
+           croak("dbi_profile_merge_nodes(%s,...) destination is not an array 
reference", neatsvpv(dest,0));
        if (items <= 1) {
            (void)cv;   /* avoid unused var warnings */
            (void)ix;

Modified: dbi/trunk/lib/DBI/Gofer/Execute.pm
==============================================================================
--- dbi/trunk/lib/DBI/Gofer/Execute.pm  (original)
+++ dbi/trunk/lib/DBI/Gofer/Execute.pm  Wed Aug 15 09:23:37 2007
@@ -308,7 +308,7 @@
     my $dbh;
     my $rv_ref = eval {
         $dbh = $self->_connect($request);
-        my $args = $request->dbh_method_call; # [ 'method_name', @args ]
+        my $args = $request->dbh_method_call; # [ wantarray, 'method_name', 
@args ]
         my $wantarray = shift @$args;
         my $meth      = shift @$args;
         $stats->{method_calls_dbh}->{$meth}++;
@@ -617,7 +617,7 @@
         #no warnings 'uninitialized';
         #warn "_mk_rand_callback($fail_percent:$fail_modrate, 
$delay_percent:$delay_modrate): seqn=$seqn fail=$fail delay=$delay";
         if ($delay) {
-            my $msg = "DBI_GOFER_RANDOM delaying execution of $method by 
$delay_duration seconds\n";
+            my $msg = "DBI_GOFER_RANDOM delaying execution of $method() by 
$delay_duration seconds\n";
             # Note what's happening in a trace message. If the delay percent 
is an odd
             # number then use warn() so it's sent back to the client
             ($delay_percent % 2 == 0) ? $h->trace_msg($msg) : warn($msg);
@@ -625,7 +625,7 @@
         }
         if ($fail) {
             undef $_; # tell DBI to not call the method
-            return $h->set_err(1, "fake error induced by DBI_GOFER_RANDOM env 
var");
+            return $h->set_err(1, "fake error from $method method induced by 
DBI_GOFER_RANDOM env var ($fail_percent%)");
         }
         return;
     }

Reply via email to