parsed.org

Tips by tag: errors

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
FIFOs Are Great by xinu on Jan 12, 2005 10:52 AM

If you want to tail the errors on another terminal, just push them to a fifo:

$ mkfifo pgerror
$ psql -U user dbname < ./dbfile 2> pgerror

On your other terminal:

$ tail -f pgerror

Voila! STDOUT on the main terminal, and STDERR on the secondary.

commandserrorsmkfifopipepsqlredirectshelltailterminal
RSS