X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/chopwood/blobdiff_plain/1f8350d2e314e9497fd58c11a125f15b51e98238..5b7c6334a8922d1fe49fb713d4432cbe667133f2:/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 = "
There ought to be a warning below.\n") + ###-------------------------------------------------------------------------- ### Static content.