From 0dbafa27fab14be0ee77036f6754f22489e5d311 Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Thu, 2 May 2024 02:07:10 -0700 Subject: [PATCH] Add logging for db3 write errors in spoolnews.php. --- Rocksolid_Light/rocksolid/newsportal.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Rocksolid_Light/rocksolid/newsportal.php b/Rocksolid_Light/rocksolid/newsportal.php index 3fbed2f..70dc285 100644 --- a/Rocksolid_Light/rocksolid/newsportal.php +++ b/Rocksolid_Light/rocksolid/newsportal.php @@ -2172,6 +2172,9 @@ function insert_article_from_array($this_article, $check_duplicates = true) // Open articles Database if ($CONFIG['article_database'] == '1') { $article_dbh = article_db_open($spooldir . '/' . $group . '-articles.db3'); + if(!$article_dbh) { + return "441 Cannot open " . $spooldir . '/' . $group . "-articles.db3\r\n"; + } $article_sql = 'INSERT OR IGNORE INTO articles(newsgroup, number, msgid, date, name, subject, article, search_snippet) VALUES(?,?,?,?,?,?,?,?)'; $article_stmt = $article_dbh->prepare($article_sql); } @@ -2179,6 +2182,10 @@ function insert_article_from_array($this_article, $check_duplicates = true) $database = $spooldir . '/articles-overview.db3'; $table = 'overview'; $overview_dbh = overview_db_open($database, $table); + if(!$overview_dbh) { + $article_dbh = null; + return "441 Cannot open " . $database . "\r\n"; + } $overview_sql = 'INSERT OR IGNORE INTO overview(newsgroup, number, msgid, date, datestring, name, subject, refs, bytes, lines, xref) VALUES(?,?,?,?,?,?,?,?,?,?,?)'; $overview_stmt = $overview_dbh->prepare($overview_sql);