parsed.org

Tips by tag: cgi

Automatic Traceback Formatting by cygnus on Aug 07, 2005 10:14 PM

Add the following code to the top of a CGI Python script to enable colorized, annotated traceback formatting whenever a fatal error occurs in your script:

import cgitb; cgitb.enable()

When in development mode, this is likely more helpful than a '500 Internal Server Error'.

cgicolorerrorsfatalimportlanguagesmodulesprogrammingpythonscripttraceback
Fatals to Browser by xinu on Sep 10, 2005 12:21 AM

An essential part of any CGI written in perl that will push all the fatal errors to the browser instead of punting with the all-too-familiar 500 Internal Server error:

use CGI::Carp qw(fatalsToBrowser);
carpcgilanguagesmodulesperlprogramming
RSS