From: Paul Hänsch Date: Wed, 11 May 2022 16:21:13 +0000 (+0200) Subject: error pages 409 and 500 X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=4d35c26aaac2a8738a8831118671d7a70dca827c;p=shellwiki error pages 409 and 500 --- diff --git a/macros/errormessage b/macros/errormessage new file mode 100755 index 0000000..c95688a --- /dev/null +++ b/macros/errormessage @@ -0,0 +1,7 @@ +#!/bin/sh + +. "$_EXEC/cgilite/cgilite.sh" + +if [ "$1" -o "$ERROR_MSG" ]; then + printf '

%s

' "$(HTML "${1:-${ERROR_MSG}}")" +fi diff --git a/pages/[wiki]/409/#page.md b/pages/[wiki]/409/#page.md new file mode 100644 index 0000000..0727e7c --- /dev/null +++ b/pages/[wiki]/409/#page.md @@ -0,0 +1,9 @@ +%nocache + +409 +=== + +**Conflict** +<> + +<> diff --git a/pages/[wiki]/500/#page.md b/pages/[wiki]/500/#page.md new file mode 100644 index 0000000..0d56e0a --- /dev/null +++ b/pages/[wiki]/500/#page.md @@ -0,0 +1,9 @@ +%nocache + +500 +=== + +**Internal Server Error** +<> + +<> diff --git a/themes/default.sh b/themes/default.sh index 9826a79..36710db 100755 --- a/themes/default.sh +++ b/themes/default.sh @@ -192,3 +192,23 @@ theme_404(){ printf "Content-Length: 0\r\n\r\n" fi } + +theme_409(){ + printf "%s\r\n" "Status: 409 Conflict" + + if [ "$(mdfile '/[wiki]/409/')" ]; then + theme_page '/[wiki]/409/' + else + printf "Content-Length: 0\r\n\r\n" + fi +} + +theme_500(){ + printf "%s\r\n" "Status: 500 Internal Server Error" + + if [ "$(mdfile '/[wiki]/500/')" ]; then + theme_page '/[wiki]/500/' + else + printf "Content-Length: 0\r\n\r\n" + fi +}