Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Customizing SOFTWARE ERROR messages

Quote Reply
Customizing SOFTWARE ERROR messages
I have playing around with editing CARP.PM and CGI.PM for awhile now to print custom FATAL SOFTWARE ERROR messages to no avail....

I have done the following:

1) Downloaded the most recent copy of CARP and CGI from http://www.cpan.org.

2) Edited the SOFTWARE ERROR codes.

3) Uploaded the CUSTOM files in the Links folder.

4) Changed the Carp/CGI references to:

Code:

use Links::CGI();
use Links::Carp qw/fatalsToBrowser/;


Yes...I also tried using require...

Anyone have any ideas how to customize CGI::Carp to print custom error messages (with custom header/footer)??

Regards,

Eliot Lee
Quote Reply
Re: Customizing SOFTWARE ERROR messages In reply to
Use Links SQL 2? ;) Seriously, I found this quite difficult to do with Carp. They suggest:

Code:
use CGI::Carp qw(fatalsToBrowser set_message);
BEGIN {
sub handle_errors {
my $msg = shift;
print "<h1>Oh gosh</h1>";
print "Got an error: $msg";
}
set_message(\&handle_errors);
}
Which you could add at the top of your scripts.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Customizing SOFTWARE ERROR messages In reply to
Thanks, Alex...I will play around with the codes and see what I can come up with....

Regards,

Eliot Lee