X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/4aab5f0a73e9e4643ce8174613bd700cf7c3ab68..5a7a89ffc59d008a6dd6586d26ff1a1fbb3bc51f:/IkiWiki/Plugin/external.pm?ds=inline diff --git a/IkiWiki/Plugin/external.pm b/IkiWiki/Plugin/external.pm index a5afdc4be..2650a8cd1 100644 --- a/IkiWiki/Plugin/external.pm +++ b/IkiWiki/Plugin/external.pm @@ -59,15 +59,17 @@ sub rpc_call ($$;@) { #{{{ error("XML RPC parser failure: $r") unless ref $r; if ($r->isa('RPC::XML::response')) { my $value=$r->value; - if ($value->isa('RPC::XML::array')) { + if ($r->is_fault($value)) { + # throw the error as best we can + print STDERR $value->string."\n"; + return ""; + } + elsif ($value->isa('RPC::XML::array')) { return @{$value->value}; } elsif ($value->isa('RPC::XML::struct')) { return %{$value->value}; } - elsif ($value->isa('RPC::XML::fault')) { - die $value->string; - } else { return $value->value; } @@ -177,7 +179,8 @@ sub hook ($@) { #{{{ delete $params{call}; IkiWiki::hook(%params, call => sub { - IkiWiki::Plugin::external::rpc_call($plugin, $callback, @_) + my $ret=IkiWiki::Plugin::external::rpc_call($plugin, $callback, @_); + return $ret; }); } #}}}