[system] / trunk / webwork / system / lib / Global.pm Repository:
ViewVC logotype

Diff of /trunk/webwork/system/lib/Global.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 195 Revision 196
531} 531}
532 532
533 533
534 534
535### dump a (hopefully) descriptive error to the browser and quit 535### dump a (hopefully) descriptive error to the browser and quit
536#sub wwerror { 536
537# my($title, $msg, $url, $label, $query_string) = @_;
538#
539# print "content-type: text/html\n\n
540# <HTML><HEAD><TITLE>Error: $title</TITLE></HEAD>
541# <BODY BACKGROUND=\"$background_warn_url\">
542# <H1>Error: $title</H1>\n $msg \n";
543# if ($url) {
544# print "<FORM ACTION=\"$url\">
545# <INPUT TYPE=SUBMIT VALUE=\"$label\">
546# </FORM>\n";
547# }
548# print "</BODY></HTML>";
549# &log_error($title, $query_string);
550# exit 1;
551#}
552 537
553sub wwerror { 538sub wwerror {
554 my($title, $msg, $url, $label, $query_string) = @_; 539 my($title, $msg, $url, $label, $query_string) = @_;
555 # <BODY BACKGROUND=\"$background_warn_url\"> 540 # <BODY BACKGROUND=\"$background_warn_url\">
556 541
743 } 728 }
744 729
745 $SIG{__WARN__}=\&PG_warnings_handler; 730 $SIG{__WARN__}=\&PG_warnings_handler;
746 731
747 $SIG{__DIE__} = sub { 732 $SIG{__DIE__} = sub {
733 my $message = longmess(@_);
734 $message =~ s/\n/<BR>\n/;
735 my ($package, $filename, $line) = caller();
736 # use standard die for errors eminating from XML::Parser::Expat
737 # it uses a trapped eval which sometimes fails -- apparently on purpose
738 # and the error is handled by Expat itself. We don't want
739 # to interfer with that.
740
741 if ($package eq 'XML::Parser::Expat') {
742 die @_;
743 }
744 #print "$package $filename $line \n";
745 print
748 print "Content-type: text/html\r\n\r\n <h4>Software error</h4> @_<br> 746 "Content-type: text/html\r\n\r\n <h4>Software error</h4> <p>\n\n$message\n<p>\n
749 Please inform the webwork meister.<p> 747 Please inform the webwork meister.<p>\n
750 In addition to the error message above the following warnings were detected: 748 In addition to the error message above the following warnings were detected:
751 <HR> 749 <HR>
752 $Global::WARNINGS; 750 $Global::WARNINGS;
753 <HR> 751 <HR>
754 It's sometimes hard to tell exactly what has gone wrong since the 752 It's sometimes hard to tell exactly what has gone wrong since the
755 full error message may have been sent to 753 full error message may have been sent to
756 standard error instead of to standard out. 754 standard error instead of to standard out.
757 <p> To debug you can 755 <p> To debug you can
758 <ul> 756 <ul>
759 <li> guess what went wrong and try to fix it. 757 <li> guess what went wrong and try to fix it.
760 <li> call the offending script directly from the command line 758 <li> call the offending script directly from the command line
761 of unix 759 of unix
762 <li> enable the debugging features by redefining 760 <li> enable the debugging features by redefining
763 \$cgiURL in Global.pm and checking the redirection scripts in 761 \$cgiURL in Global.pm and checking the redirection scripts in
764 system/cgi. This will force the standard error to be placed 762 system/cgi. This will force the standard error to be placed
765 in the standard out pipe as well. 763 in the standard out pipe as well.
766 <li> Run tail -f error_log <br> 764 <li> Run tail -f error_log <br>
767 from the unix command line to see error messages from the webserver. 765 from the unix command line to see error messages from the webserver.
768 The standard error output is being placed in the error_log file for the apache 766 The standard error output is being placed in the error_log file for the apache
769 web server. To run this command you have to be in the directory containing the 767 web server. To run this command you have to be in the directory containing the
770 error_log or enter the full path name of the error_log. <p> 768 error_log or enter the full path name of the error_log. <p>
771 In a standard apache installation, this file is at /usr/local/apache/logs/error_log<p> 769 In a standard apache installation, this file is at /usr/local/apache/logs/error_log<p>
772 In a RedHat Linux installation, this file is at /var/log/httpd/error_log<p> 770 In a RedHat Linux installation, this file is at /var/log/httpd/error_log<p>
773 At Rochester this file is at /ww/logs/error_log. 771 At Rochester this file is at /ww/logs/error_log.
774 </ul> 772 </ul>
775 Good luck./n" ; exit(0); 773 Good luck.<p>\n" ;
776 }; 774 };
777 775
778 776
779 777
780} 778}

Legend:
Removed from v.195  
changed lines
  Added in v.196

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9