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

Have you tried wrapping the call in eval {}?  As I read the docs, the method ->call() is expected to raise an exception (i.e. die) on error.

Replies are listed 'Best First'.
Re^2: Frontier::Client - script quits on error respons
by DreamT (Pilgrim) on Feb 21, 2011 at 14:16 UTC
    I haven't tried that, since I didn't see how I can capture the returned error code. But maybe that is stored in $@ ?

      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