diff options
author | matthew <matthew> | 2009-07-15 20:51:21 +0000 |
---|---|---|
committer | matthew <matthew> | 2009-07-15 20:51:21 +0000 |
commit | 3a66facfc1c39c19d4e53cdfacaa433a45e44d52 (patch) | |
tree | b9b94bc3d0fefa60870354b8b8225fc08e97ab7f /web/test.cgi | |
parent | 217fb0207d32dd96b1960d93470a065ffcf6df7c (diff) |
Add error test script.
Diffstat (limited to 'web/test.cgi')
-rwxr-xr-x | web/test.cgi | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/web/test.cgi b/web/test.cgi new file mode 100755 index 000000000..c9b36e6b7 --- /dev/null +++ b/web/test.cgi @@ -0,0 +1,25 @@ +#!/usr/bin/perl -w -I../perllib + +# test.cgi +# Part of test suite to force an error to check error handling works. +# +# Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved. +# Email: matthew@mysociety.org. WWW: http://www.mysociety.org +# +# $Id: test.cgi,v 1.1 2009-07-15 20:51:21 matthew Exp $ + +use strict; +use Standard; + +sub main { + my $q = shift; + + print $q->header(-charset => 'utf-8', -content_type => 'text/plain'); + if ($q->param('error')) { + print 10 / 0; # Cause an error by dividing by zero. + } + print "Success"; +} + +Page::do_fastcgi(\&main); + |