From b476a31e7179fa188236ab02d5e66c28ce553008 Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Sat, 22 Nov 2025 14:34:12 -0800 Subject: [PATCH] Update error handling and logging --- javascript/gallery.js | 4 ++-- javascript/indexdb.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/javascript/gallery.js b/javascript/gallery.js index d502b3635..9f7e4c34c 100644 --- a/javascript/gallery.js +++ b/javascript/gallery.js @@ -577,8 +577,8 @@ async function thumbCacheCleanup() { const t1 = performance.now(); log(`Thumbnail DB cleanup: kept=${thumbHashes.size} deleted=${delcount} time=${Math.floor(t1 - t0)}ms`); }) - .catch(() => { - log("Thumbnail DB cleanup: Cleanup failed"); + .catch((err) => { + error("Thumbnail DB cleanup: Cleanup failed.", err.message); }) .finally(() => { idbIsCleaning = false; diff --git a/javascript/indexdb.js b/javascript/indexdb.js index 841e41748..8ba984903 100644 --- a/javascript/indexdb.js +++ b/javascript/indexdb.js @@ -102,7 +102,7 @@ async function idbCount() { async function idbClean(keepSet) { if (!db) return null; if (!keepSet instanceof Set) { - console.error("IndexedDB cleaning function must be given a Set() of hashes to keep"); + throw new TypeError("IndexedDB cleaning function must be given a Set() of hashes to keep"); }; return new Promise((resolve, reject) => { let counter = 0;