]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/inline.pm
* Wrap entire technortati ping operation in an eval to catch all possible
[ikiwiki.git] / IkiWiki / Plugin / inline.pm
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: $@";
                        }
                }
        }