Loading ...
Sorry, an error occurred while loading the content.

4500Re: [soaplite] on fault(): finding the real error message

Expand Messages
  • Duncan Cameron
    Mar 25, 2005
      At 2005-03-24, 19:08:35 Sebastien Boving & Nicole Kersting
      <sebbov@...> wrote:
      >i'm having several instances where using an on_fault() handler which
      >has the same form as the t/...t tests that come with SOAP::Lite, that
      > on_fault => sub {
      > my $soap = shift;
      > my $res = shift;
      > ref $res ? warn(join " ", "SOAP FAULT:", $res->faultstring, "\n")
      > : warn(join " ", "TRANSPORT ERROR:",
      >$soap->transport->status, "\n");
      > return new SOAP::SOM;
      > }
      That doesn't look like a good example of a fault handler, as passing
      back an empty SOM object will mislead the client.

      >return weird:
      Well, in the case that $res is not a reference you are not printing its

      value. I would expect that value to indicate the problem.
      The default on_fault handler, which you can see in the source for
      SOAP::Lite, is probably fine for what you need. If the error is a
      SOAP::SOM object then it will be passed back to the client, otherwise
      it will die.


      Send instant messages to your online friends http://uk.messenger.yahoo.com