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

Reporting errors

Expand Messages
  • Dan Muey
    I m trying to get erros to report better, here is what I have print header; my $soap = SOAP::Lite - uri( http://www.simplemood.com/Uri_$uri_prxy ) -
    Message 1 of 1 , Jan 29, 2003
    • 0 Attachment
      I'm trying to get erros to report better, here is what I have

      print header;

      my $soap = SOAP::Lite
      -> uri("http://www.simplemood.com/Uri_$uri_prxy")
      -> proxy("$http_prot\://$domain/$uri_prxy.cgi")
      -> on_fault(sub { my($soap, $res) = @_;
      die ref $res ? $res->faultdetail :
      $soap->transport->status, "\n";
      });

      That works but if I set the url to a non existing one or change the server so that it's bad syntax I get


      VIA command line :

      Content-type: text/html

      400 file non existant
      And
      Content-type: text/html

      500 Internal Server error
      Respectively.

      Which is what I'd expect. But when I do it via browser I get blank page and when I view source I get

      <html><body></body></html>

      Which isn't output like that not where in my script.

      How can I modify it so that if the server returns a standard error, 401, 404, 411, 500 etc it will simply print that to the browser?
      How would I implement n subroutine error to the browser and quit also ( same result as the 404 idea above but custom like )

      EG

      package Feedme;

      sub Monkey {
      ....
      if($bananna = 'rotten') { die "You must give me good banana!"; }
      else {
      ....
      }
      }

      Do I need to move on_fault or am I totally screwy for using on_fault for what I'm trying to do?

      I think this will be the last time I bug you guys for a while!
      Thanks I really appreciate it and really love SOAP::Lite!!

      Dan
    Your message has been successfully submitted and would be delivered to recipients shortly.