summaryrefslogtreecommitdiff
path: root/scripts/driver
Commit message (Collapse)AuthorAgeFilesLines
* Very substantially rewritten. The old driver script let too manybwarsaw1998-07-311-60/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | uncaught exceptions through to the top level. Uncommented out the open() definition. I think this is very helpful during the beta debugging phase. We'll comment this out for 1.0 release (it also won't be necessary in Python 1.5.2, but nobody has that yet!) Exception printing has been changed so that the MultiLogger is no longer necessary. Removes one more potential crash, but also rationalizes print_exception() and print_environment(). There's always exactly two places information goes: 1. To a plain text log file. This could be sys.__stderr__ if no explicit log file is given -- e.g. the Web server's log file. 2. To an HTML sink. This will always be sys.stdout (since we use the `print' statement), and will generally always be connected to the input of the Web browser. Log file printing happens first, just in case (it's better that the server knows what's happening), but we always try to print both. `Main' has been rewritten also. We now do not catch any problems with import sys. If sys can't be imported, then the Python installation is royally screwed -- even `print' won't work! Better to just let the catastrophy percolate up to the Web browser. Even so this should almost never happen. Poke __stderr__ and __stdout__ into the sys module if they aren't already there. GvR says this is a 1.5.1 feature, but we can make it work well enough for older versions of Python, and it's convenient. Give one final shot at printing the traceback and environment if the exception percolates all the way up out of run_main(). This time, just print them to stderr (usually meaning the Web server's error log). Should this fail too, do whatever we can not to generate an end-user visible server error.
* run_main(): initialize logger and multi to sys.stderr. This is inbwarsaw1998-07-291-0/+5
| | | | | | | case anything breaks between the start of this function and the creation of the real objects, otherwise the calls in the except branch will fail, kicking us back to a low-level exception. using sys.stderr isn't great, but it's better than nothing.
* Added a useful debugging hack (commented out).bwarsaw1998-07-221-0/+21
|
* Use the new Mailman.Logging package to provide better logging onbwarsaw1998-07-021-20/+23
| | | | | | | | errors. Now all tracebacks get sent to the user as HTML *and* logged to logs/error, although the format of the output is slightly different (not HTML in the latter case). Some rearranging of code, simplification, etc.
* New CGI driver script that attempts to import the real script from thebwarsaw1998-06-191-0/+147
Mailman.Cgi package. Be as paranoid as possible about catching exceptions and reporting them as HTML (which has saved my butt numerous times already :-). See the comments in the file for things that can still cause Server errors.