From 88789026794d0efac05416d06b4c8fd1e5b39f9d Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Thu, 26 Jan 2023 20:09:02 +0000 Subject: [PATCH] Add Error page and error handling Signed-off-by: Fred Boniface --- static/404.html | 30 ++++++++++++++++++++++++++++++ static/50x.html | 30 ++++++++++++++++++++++++++++++ static/conf/nginx.conf | 2 ++ static/js/simple-board.js | 2 ++ 4 files changed, 64 insertions(+) create mode 100644 static/404.html create mode 100644 static/50x.html diff --git a/static/404.html b/static/404.html new file mode 100644 index 0000000..e5feb93 --- /dev/null +++ b/static/404.html @@ -0,0 +1,30 @@ + + + + + + + + + + + + + OwlBoard - Error + + +
+ +
+ + + + + OwlBoard Logo + +

Oh no!

+

That page cannot be found

+

Try going to the homepage

+

Error number: 404

+ + \ No newline at end of file diff --git a/static/50x.html b/static/50x.html new file mode 100644 index 0000000..aa2d01e --- /dev/null +++ b/static/50x.html @@ -0,0 +1,30 @@ + + + + + + + + + + + + + OwlBoard - Error + + +
+ +
+ + + + + OwlBoard Logo + +

Oh no!

+

OwlBoard has encountered a Server Error

+

Try going to the homepage

+

Error number: 50x

+ + \ No newline at end of file diff --git a/static/conf/nginx.conf b/static/conf/nginx.conf index 86d091b..35f9fe3 100644 --- a/static/conf/nginx.conf +++ b/static/conf/nginx.conf @@ -32,6 +32,8 @@ http { index index.html; gzip_static on; brotli_static on; + error_page 404 /404.html; + error_page 500 501 502 503 504 505 /50x.html; } location /api/ { diff --git a/static/js/simple-board.js b/static/js/simple-board.js index f5ab835..2e9d35d 100644 --- a/static/js/simple-board.js +++ b/static/js/simple-board.js @@ -23,6 +23,8 @@ async function init() { var data = null setLoadingDesc(`Handling\nError`) log("init: Unable to fetch LDB data") + await delay(2000); + location.reload(); } } }