Warn will pump it into the web servers logs not out to the browser.

I've done a few things to handle what your thinking:

Use 'die' instead of warn with fatalsToBrowser turned on for CGI (Search 
CGI.pm documentation for fatalsToBrowser

For a neater appearance, make a template and stick the error code into 
it and return it instead

Another thing I do is make a sysmessage field in my templates in a 
comment block.  I set it to whatever debug info I want to drop - when I 
get the page I view source and there is all my benchmarking, warnings, 
etc...


-----Original Message-----
From: odounga [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 17, 2001 7:46 AM
To: cgiapp
Subject: [cgiapp] Error Handling with CGI::Application


Hi!

I'm a Perl novice and currently trying to develop a CGI::Application 
based 
web-system.

I can't figure out how to display an error page to the user when an 
exception occurred in a sub called by a run-mode.

In the sub I'm doing a conditional like this

unless ( $object->do_yourself() ) {
  warn "CRITICAL: Error, object can not do itself!\n";
  return;
}

I'm looking for a mechanism for returning this error message to the 
browser. 
Currently, it just warn "Document contains no data" and didn't update 
the 
screen.

Thanks for your support and invaluable time.

Regards,

Roses Longin Odounga

Falltorweg 4
D-65428 R�sselsheim
Tel. +49 (0) 6142 - 938978
GSM  +49 (0) 173  - 3201063
Mailto [EMAIL PROTECTED]
http://www.gabon-net.com


_________________________________________________________________
Downloaden Sie MSN Explorer kostenlos unter 
http://explorer.msn.de/intl.asp


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to