From 953986f0aff7329d97bc26a641c1d713eb16f7e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Mon, 12 Feb 2024 21:57:38 +0100 Subject: [PATCH] Add error handling for writing to /blog/index.html in _blog_index function --- qsgen2 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qsgen2 b/qsgen2 index 9b30d7c..9a71060 100755 --- a/qsgen2 +++ b/qsgen2 @@ -919,7 +919,10 @@ function _blog_index() { _msg debug "_blog_index: Content of blog_index_content" _msg sub "${blog_index_content}" fi - echo "$blog_index_content" > ${www_root}/blog/index.html + echo "$blog_index_content" > ${www_root}/blog/index.html || { + echo "Failed to write to ${www_root}/blog/index.html" + exit 1 + } _f_last_updated ${www_root}/blog/index.html fi