Update error handling and logging

This commit is contained in:
awsr
2025-11-22 14:34:12 -08:00
parent cfae4a5f1f
commit b476a31e71
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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;