X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/chopwood/blobdiff_plain/9e574017f801c1bb4b5d4856e988b892d90246a2..1e83d6d9ae0d486fc1205e70123a356220db3bff:/cmd-cgi.py diff --git a/cmd-cgi.py b/cmd-cgi.py index 104dd6a..f6bbe94 100644 --- a/cmd-cgi.py +++ b/cmd-cgi.py @@ -112,6 +112,17 @@ def cmd_fail_cgi(partial = False):

This is some normal output which will be rudely interrupted.""") raise Exception, 'You asked for this.' +@CGI.subcommand( + 'warn', ['cgi-noauth'], + 'Raise an exception, to test the error reporting machinery.') +def cmd_warn_cgi(): + OUT.header(content_type = 'text/html') + OUT.warn("Here's a very important warning.") + CGI.format_tmpl(CGI.TMPL['wrapper.fhtml'], + title = "Warning test", warnings = OUT.warnings, + payload = "

Chopwood: warning test

\n" + "

There ought to be a warning below.\n") + ###-------------------------------------------------------------------------- ### Static content.