From 07dd20c4443a2231bda204744bfa553c8055de00 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 30 Nov 2009 18:08:07 -0600 Subject: handle rpc failure better --- lib/Crawl/Bot/Plugin/Wiki.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Crawl/Bot/Plugin/Wiki.pm b/lib/Crawl/Bot/Plugin/Wiki.pm index 586aeeb..44765d5 100644 --- a/lib/Crawl/Bot/Plugin/Wiki.pm +++ b/lib/Crawl/Bot/Plugin/Wiki.pm @@ -32,6 +32,8 @@ sub tick { my $xmlrpc = XML::RPC->new($self->xmlrpc_location); warn "Getting recent wiki changes..."; my $changes = $xmlrpc->call('wiki.getRecentChanges', $last_checked); + # ->call returns a hashref with error info on failure + return unless ref($changes) eq 'ARRAY'; for my $change (@$changes) { warn "Page $change->{name} changed"; my $history = $xmlrpc->call('wiki.getPageVersions', $change->{name}, 0); -- cgit v1.2.3-54-g00ecf