aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/CGI.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-07-12 23:23:25 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-07-12 23:23:25 -0400
commite3c0e4977449de2eec36e254a7e131693ba2f822 (patch)
tree09fd42fb4d3328a36dd3622a47cb449b68f35149 /IkiWiki/CGI.pm
parente4e3d7e2d4195bcd22c467522719c9c6dd39216b (diff)
downloadikiwiki-e3c0e4977449de2eec36e254a7e131693ba2f822.tar
ikiwiki-e3c0e4977449de2eec36e254a7e131693ba2f822.tar.gz
only htmlize errors when cgi is actually running
Diffstat (limited to 'IkiWiki/CGI.pm')
-rw-r--r--IkiWiki/CGI.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index 6770f6feb..d805506aa 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -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