]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/CGI.pm
edit page fixup in postrename
[ikiwiki.git] / IkiWiki / CGI.pm
index 2a847eb1733ba275c31d4880d9f356fd847ec80a..d805506aa9dd1a62940d82599375b8b284fde262 100644 (file)
@@ -1,5 +1,7 @@
 #!/usr/bin/perl
 
+package IkiWiki;
+
 use warnings;
 use strict;
 use IkiWiki;
@@ -7,8 +9,6 @@ use IkiWiki::UserInfo;
 use open qw{:utf8 :std};
 use Encode;
 
-package IkiWiki;
-
 sub printheader ($) { #{{{
        my $session=shift;
        
@@ -750,4 +750,14 @@ sub cgi (;$$) { #{{{
        }
 } #}}}
 
+# Does not need tobe called directly; all errors will go through here.
+sub cgierror ($) { #{{{
+       my $message=shift;
+
+       print "Content-type: text/html\n\n";
+       print misctemplate(gettext("Error"),
+               "<p class=\"error\">".gettext("Error").": $message</p>");
+       die $@;
+} #}}}
+
 1