in reply to Re: Frontier::Client - script quits on error respons
in thread Frontier::Client - script quits on error respons

I haven't tried that, since I didn't see how I can capture the returned error code. But maybe that is stored in $@ ?
  • Comment on Re^2: Frontier::Client - script quits on error respons

Replies are listed 'Best First'.
Re^3: Frontier::Client - script quits on error respons
by Eliya (Vicar) on Feb 21, 2011 at 14:40 UTC

    The call() method ends like this:

    sub call { ... if ($result->{'type'} eq 'fault') { die "Fault returned from XML RPC Server, fault code " . $resul +t->{'value'}[0]{'faultCode'} . ": " . $result->{'value'}[0]{'faultString'} . "\n"; } return $result->{'value'}[0]; }

    so, when it dies (raises an exception), you'll get the message "Fault returned from XML RPC Server, fault code ...: ..." in $@.

    As you can see, the message includes the faultCode and faultString, so you'd have to extract it from there.

    In case there is no fault, it returns whatever is in $result->{'value'}[0].

      I'm running into a similar issue, I'm capturing the output of die in $@ but I'd like to extract faultString and faultCode separately. Data Dumper shows the entire message as one variable, is there a way to extract faultString and faultCode separately from this module? Thanks, Vadim
      I'm running into a similar issue, I'm capturing the output of die in $@ but I'd like to extract faultString and faultCode separately. Data Dumper shows the entire message as one variable, is there a way to extract faultString and faultCode separately from this module? Thanks, Vadim