While I've been looking into this, I found out the Systems guys got pressed for a solution too and they are installing a monitoring tool that will crawl the site and notify me and other when stuff goes down. So, code changes are no longer needed.
Wasted effort and poor communication FTL! Thanks for looking at it though! Doug Dawson wrote: > Hello everyone! I'm have a Perl problem that I hope someone can help me > with. I posted this to SitePoint, but since there's Mason involved, I > wanted to get some input from Mason users, too. > > I know this is big, but I wanted to make sure everyone had enough info > to help me. Thanks for taking the time to read it! > > I have some OO Perl that handles getting a quote to the user for > insurance. Recently, the Systems people moved a server and didn't > include a proxy entry for said service. When the users tried to get a > quote, a nasty Mason stack dump appeared instead. > > I need to make it that if the script loses communication with the Java > server, it can die nicely. I don't have much OO Perl experience and was > hoping someone could give me a hand. > > This code is inherited, too, so if there's something that can be done > better, let me know. > > Here's part of the code from that executes on the presentation to the > user. The stack dump indicates that there is an error in the package > MedsuppQuote. A little farther down you can see where the original > author attempted to check to see if an object was created. Afterwards, > of course, is the code to read the values returned. > > Code: > > <%args> > $zipcode => undef > $debug => 0 > </%args> > <%perl> > use PMIC::MedsuppQuote; > > my $serviceDownError = '<p>Unable to retrieve a quote at this time, > please try again later, or <a href="/contact_us/">Contact Us</a>.</p>'; > > my $invalidQuote = '<p>We\'re sorry. Online pricing information is not > available in your state. Contact us by <a href="/contact_us/">email</a> > or call us at 1-800-932-7642.</p>'; > . > . > . > if (not(ref($attained_age_quote) ne "PMIC::MedsuppQuote")) { > $error = $serviceDownError; > > =========================== > > To simulate a comm failure, I changed the production URL to something > that doesn't exist. You may notice that I tried disabling the strict > option to see if that would help, but it did not. > > Code: > > package PMIC::MedsuppQuote; > BEGIN{ > require PMIC::Object; > @ISA = qw/PMIC::Object/; > } > > #use strict; > use SOAP::Lite; > > my $URI = "urn:MedsuppQuoteService"; > my $PROD_URL = "http://somehost.someserver.com/" > > sub new{ > my($self) = (shift); > unshift @_, url=>$PROD_URL; > unshift @_, plan=>'Plan A'; > . > . > . > > =============== > > Finally here is the error message that Mason dumps to the browser: > > Code: > > Error during compilation of /opt/apache/htdocs/msp/get_quote.mhtml: > syntax error at /usr/local/perl-5.8.5/lib/site_perl/PMIC/MedsuppQuote.pm > line 16, near "sub new" > Can't use global @_ in "my" at > /usr/local/perl-5.8.5/lib/site_perl/PMIC/MedsuppQuote.pm line 18, near > "unshift @_" > syntax error at /usr/local/perl-5.8.5/lib/site_perl/PMIC/MedsuppQuote.pm > line 28, near "}" > Compilation failed in require at /opt/apache/htdocs/msp/get_quote.mhtml > line 6. > > Stack: > [/opt/apache/htdocs/msp/get_quote.mhtml:6] > [/usr/local/perl-5.8.5/lib/site_perl/PMIC/MedsuppQuote.pm:6] > [/usr/local/perl-5.8.5/lib/site_perl/5.8.5/HTML/Mason/Interp.pm:543] > [/usr/local/perl-5.8.5/lib/site_perl/5.8.5/HTML/Mason/Interp.pm:320] > [/usr/local/perl-5.8.5/lib/site_perl/5.8.5/HTML/Mason/Request.pm:892] > [/usr/local/perl-5.8.5/lib/site_perl/5.8.5/HTML/Mason/Request.pm:996] > [/opt/apache/htdocs/msp/quote2007/index.html:133] > [/opt/apache/htdocs/msp/autohandler:9] > [/opt/apache/htdocs/autohandler:29] > BEGIN failed--compilation aborted at > /opt/apache/htdocs/msp/get_quote.mhtml line 6. > > Stack: > [/opt/apache/htdocs/msp/get_quote.mhtml:6] > [/usr/local/perl-5.8.5/lib/site_perl/5.8.5/HTML/Mason/Interp.pm:543] > [/usr/local/perl-5.8.5/lib/site_perl/5.8.5/HTML/Mason/Interp.pm:320] > [/usr/local/perl-5.8.5/lib/site_perl/5.8.5/HTML/Mason/Request.pm:892] > [/usr/local/perl-5.8.5/lib/site_perl/5.8.5/HTML/Mason/Request.pm:996] > [/opt/apache/htdocs/msp/quote2007/index.html:133] > [/opt/apache/htdocs/msp/autohandler:9] > [/opt/apache/htdocs/autohandler:29] > > context: > ... > 2: $zipcode => undef > 3: $debug => 0 > 4: </%args> > 5: <%perl> > 6: use PMIC::MedsuppQuote; > . > . > . > > -- Doug Dawson Web Developer Physicians Mutual Insurance Company (402) 930-2432 It has become appallingly obvious that our technology has exceeded our humanity. ____________________________________________________________ This message and any attachments are confidential, may contain privileged information, and are intended solely for the recipient named above. If you are not the intended recipient, or a person responsible for delivery to the named recipient, you are notified that any review, distribution, dissemination or copying is prohibited. If you have received this message in error, you should notify the sender by return email and delete the message from your computer system. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users