]> git.plutz.net Git - shellwiki/commitdiff
error pages 409 and 500
authorPaul Hänsch <paul@plutz.net>
Wed, 11 May 2022 16:21:13 +0000 (18:21 +0200)
committerPaul Hänsch <paul@plutz.net>
Wed, 11 May 2022 16:21:13 +0000 (18:21 +0200)
macros/errormessage [new file with mode: 0755]
pages/[wiki]/409/#page.md [new file with mode: 0644]
pages/[wiki]/500/#page.md [new file with mode: 0644]
themes/default.sh

diff --git a/macros/errormessage b/macros/errormessage
new file mode 100755 (executable)
index 0000000..c95688a
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+. "$_EXEC/cgilite/cgilite.sh"
+
+if [ "$1" -o "$ERROR_MSG" ]; then
+  printf '<p .error>%s</p>' "$(HTML "${1:-${ERROR_MSG}}")"
+fi
diff --git a/pages/[wiki]/409/#page.md b/pages/[wiki]/409/#page.md
new file mode 100644 (file)
index 0000000..0727e7c
--- /dev/null
@@ -0,0 +1,9 @@
+%nocache
+
+409
+===
+
+**Conflict**  
+<<errormessage>>
+
+<<reflink>>
diff --git a/pages/[wiki]/500/#page.md b/pages/[wiki]/500/#page.md
new file mode 100644 (file)
index 0000000..0d56e0a
--- /dev/null
@@ -0,0 +1,9 @@
+%nocache
+
+500
+===
+
+**Internal Server Error**  
+<<errormessage>>
+
+<<reflink>>
index 9826a79eb0670f5407a501a92a9def23ca5fb66e..36710dbd44e8194f6fd6fad0dba0dfc60e4ef4f9 100755 (executable)
@@ -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
+}