Print recent CGI error

Dan Stromberg drsalists at gmail.com
Sat Dec 4 14:33:46 EST 2010


I've sometimes got similar situations in CGI, that turned out to be
because of a syntax error that kept apache from being able to run the
script.  What if you just run the script at the command line?  It
should either error out due to lack of a CGI environment/arguments,
but hopefully it'll give you an error message that'll be useful.
Also, you might be able to get some mileage out of finding out what
env vars and command line options are being passed, and running from
the command line with those.

On Sat, Dec 4, 2010 at 10:33 AM, Gnarlodious <gnarlodious at gmail.com> wrote:
> I have a serious error that causes the process to crash. Apache
> refuses to log the error and it only happens on the server, not on the
> dev machine. Problem is, I can't figure out how to get the most recent
> error. I can find all sorts of pages telling how to print a specific
> error, but how to get an unknown error:
>
> Here is where I am:
>
> NowCookie.load(savedCookie)
> try:
>    savedCookie=NowCookie['Sectrum'].value  # PROCESS CRASHES HERE
> except:
>    print("Content-type:text/html\n\n")
>    print("???")  # PRINT WHATEVER ERROR OCCURRED
>    quit()
>
> There must be something so simple I am missing...
>
> This is Python 3.
>
> -- Gnarlie
> --
> http://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list