Tim,

Two fixes and a suggestion follow. To be applied over my most recent 
diffs.

The fixes ensure that $db_obj->state always gets called with a string of 
exactly five chars (it complains otherwise.)

The suggested change to CallMethod prevents the logs from filling with
errors in the case where we will be triggering hundreds or thousands of
them quite knowingly (client app inserts in a loop where we suppress
RaiseError and simply continue past some expected failure conditions, e.g. 
duplicate primary key.)

By feeding the death message to Debug, we can still choose to watch if
need be.

Steve




Index: Proxy.pm
===================================================================
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Proxy.pm    2002/09/10 16:56:15     1.9
+++ Proxy.pm    2002/09/12 00:33:07     1.10
@@ -61,7 +61,7 @@
 sub proxy_set_err {
   my ($h,$errmsg) = @_;
   my ($err,$state) = 
-    ($errmsg =~ s/ \[err=(.*?),state=(.*?)\]//) ? ($1,$2) : (1,5 x ' ');
+    ($errmsg =~ s/ \[err=(.*?),state=(.*?)\]//) ? ($1,$2) : (1,'     ');
 
   return DBI::set_err($h, $err, $errmsg, $state);
 }
Index: ProxyServer.pm
===================================================================
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ProxyServer.pm      2002/09/10 01:37:40     1.5
+++ ProxyServer.pm      2002/09/12 00:35:25     1.6
@@ -195,7 +195,7 @@
                                    'RaiseError' => 1,
                                    'HandleError' => sub {
                                        my $err = $_[1]->err;
-                                       my $state = $_[1]->state || '';
+                                       my $state = $_[1]->state || '     ';
                                        $_[0] .= " [err=$err,state=$state]";
                                        return 0;
                                    } })
@@ -220,7 +220,7 @@
     my $msg = $@;
     undef $dbh->{'private_server'};
     if ($msg) {
-       $server->Error($msg);
+        $server->Debug("CallMethod died with: $@");
        die $msg;
     } else {
        $server->Debug("CallMethod: <= " . join(",", @result));

Reply via email to