summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-03-15 13:49:22 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-03-15 13:49:22 -0400
commite7ce86db11174606d06a6cfabfa9c41aa3cbd50e (patch)
treef8c41af0d7228105653a443ae1307ea7e9314f5e /IkiWiki/Plugin
parentb8c55c4db282c87e3bada4491329ac3c940ff28d (diff)
* external: Fix support of XML::RPC::fault.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/external.pm13
1 files changed, 8 insertions, 5 deletions
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;
});
} #}}}