]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* Wrap entire technortati ping operation in an eval to catch all possible
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Mon, 16 Oct 2006 19:03:33 +0000 (19:03 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Mon, 16 Oct 2006 19:03:33 +0000 (19:03 +0000)
  failure modes, after I observed a simple ->value crashing ikiwiki when
  a ping failed.

IkiWiki/Plugin/inline.pm
debian/changelog

index 1ee79180c52fccc8f336c7f1dc7a6fdc02a2d919..c02aac1ce9baf54b2d057a9c21b3b932c28c7ae9 100644 (file)
@@ -314,17 +314,22 @@ sub pingurl (@) { #{{{
                my $title=pagetitle(basename($page));
                my $url="$config{url}/".htmlpage($page);
                foreach my $pingurl (@{$config{pingurl}}) {
-                       my $client = RPC::XML::Client->new($pingurl);
-                       my $req = RPC::XML::request->new('weblogUpdates.ping',
-                               $title, $url);
                        debug("Pinging $pingurl for $page");
-                       my $res = $client->send_request($req);
-                       if (! ref $res) {
-                               debug("Did not receive response to ping");
-                       }
-                       my $r=$res->value;
-                       if (! exists $r->{flerror} || $r->{flerror}) {
-                               debug("Ping rejected: ".(exists $r->{message} ? $r->{message} : "[unknown reason]"));
+                       eval {
+                               my $client = RPC::XML::Client->new($pingurl);
+                               my $req = RPC::XML::request->new('weblogUpdates.ping',
+                               $title, $url);
+                               my $res = $client->send_request($req);
+                               if (! ref $res) {
+                                       debug("Did not receive response to ping");
+                               }
+                               my $r=$res->value;
+                               if (! exists $r->{flerror} || $r->{flerror}) {
+                                       debug("Ping rejected: ".(exists $r->{message} ? $r->{message} : "[unknown reason]"));
+                               }
+                       };
+                       if ($@) {
+                               debug "Ping failed: $@";
                        }
                }
        }
index 690b4a9710ed9ba254cabe73bf79d714ecb66339..fd9cc5efab3e003e7b7414f2fc3c731cd52e48b3 100644 (file)
@@ -7,8 +7,11 @@ ikiwiki (1.30) UNRELEASED; urgency=low
   * Fix support for --pingurl at the command line.
   * Fix a subtle bug in will_render that broke some builds, by only clearing
     items from renderedfiles the first time per build.
+  * Wrap entire technortati ping operation in an eval to catch all possible
+    failure modes, after I observed a simple ->value crashing ikiwiki when
+    a ping failed.
 
- -- Joey Hess <joeyh@debian.org>  Mon, 16 Oct 2006 14:50:13 -0400
+ -- Joey Hess <joeyh@debian.org>  Mon, 16 Oct 2006 15:02:39 -0400
 
 ikiwiki (1.29) unstable; urgency=low