r43290 - in /scripts/KGB: TODO client/KGB_sendcommit

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Sun Aug 30 07:31:52 UTC 2009


Author: dmn
Date: Sun Aug 30 07:31:46 2009
New Revision: 43290

URL: http://svn.debian.org/wsvn/?sc=1&rev=43290
Log:
KGB/client: process faults synchronously, report verbosely

Modified:
    scripts/KGB/TODO
    scripts/KGB/client/KGB_sendcommit

Modified: scripts/KGB/TODO
URL: http://svn.debian.org/wsvn/scripts/KGB/TODO?rev=43290&op=diff
==============================================================================
--- scripts/KGB/TODO (original)
+++ scripts/KGB/TODO Sun Aug 30 07:31:46 2009
@@ -22,5 +22,4 @@
   + possible commands:
     - reload (should say to the channel that it is reloading)
     - 'are you alive' ('yes, master') :)
-* make sure client reports any faults verbosely
 

Modified: scripts/KGB/client/KGB_sendcommit
URL: http://svn.debian.org/wsvn/scripts/KGB/client/KGB_sendcommit?rev=43290&op=diff
==============================================================================
--- scripts/KGB/client/KGB_sendcommit (original)
+++ scripts/KGB/client/KGB_sendcommit Sun Aug 30 07:31:46 2009
@@ -123,13 +123,6 @@
     my $failure = 0;
     my $s = SOAP::Lite->new(uri => $srv->{uri}, proxy => $srv->{proxy});
     $s->transport->proxy->timeout($srv->{timeout}) if $srv->{timeout};
-    $s->on_fault(sub {
-                    my($soap, $res) = @_;
-                    $failure = 1;
-                    warn "SOAP fault while communicating with "
-                        . $srv->{uri}.": ", ref $res ? $res->faultdetail :
-                          $soap->transport->status, "\n";
-            });
 
     # v1 protocol
     my $checksum = sha1_hex($repo_id, $rev, @changed, $log, $aut, $password);
@@ -139,6 +132,14 @@
                     [ map({SOAP::Data->type(string => $_)} @changed) ],
                     SOAP::Data->type(string => $log),
                     SOAP::Data->type(string => $aut)]);
+
+    if( $res->fault ) {
+        warn 'SOAP FAULT while talking to '.$srv->{uri}."\n";
+        warn 'FAULT MESSAGE: ', $res->fault->{faultstring}, "\n";
+        warn 'FAULT DETAILS: ', $res->fault->{detail}, "\n";
+        $failure = 1;
+    }
+
     #my $res = $s->commit([
     #		$repo_id, $password, SOAP::Data->type(int => $rev),
     #		[ map({SOAP::Data->type(string => $_)} @changed) ],




More information about the Pkg-perl-cvs-commits mailing list