Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Error handling on_fault and return params to the caller file (abc.mp)

by mr.nick (Chaplain)
on Jun 28, 2012 at 13:44 UTC ( [id://978930]=note: print w/replies, xml ) Need Help??


in reply to Error handling on_fault and return params to the caller file (abc.mp)

Since SOAP::Lite natively throws exceptions via die() when an error occurs (I think?), you should do the same in your on_fault routine.

Here's what I do:

$soap->on_fault( sub { my ( $soap, $res ) = @_; if ($res) { if ( ref $res ) { die join( '; ', $res->faultcode, $res->faultstring +, $res->faultdetail ) . "\n"; } else { die $res; } } else { die "Soap Fault: " . $soap->transport->status . "\n"; } } );

Then later in the client...

eval { $soap->Method("arguments"); }; if ($@) { // provide some user feedback about the error in $@ }

mr.nick ...

Replies are listed 'Best First'.
Re^2: Error handling on_fault and return params to the caller file (abc.mp)
by nitins818@gmail.com (Initiate) on Aug 20, 2012 at 09:32 UTC
    SOAP::LITE is single threaded ???
    If it is true then how to change it to multiple?

    It can help me to save my client if my service server dies ...

    Please Help ...
      create a new soap lite object in each subthread

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://978930]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2024-03-28 22:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found