feat: add comprehensive error handling and logging for vault settings save operations with permission error detection and detailed error messages in UI toast notifications

This commit is contained in:
2026-03-26 16:00:27 -04:00
parent 2686cc5d11
commit 34f4e41419
4 changed files with 180 additions and 9 deletions
+10 -2
View File
@@ -3456,6 +3456,12 @@
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(settings)
}).then(async response => {
if (!response.ok) {
const errorData = await response.json().catch(() => ({ detail: response.statusText }));
throw new Error(errorData.detail || `HTTP ${response.status}`);
}
return response.json();
})
);
});
@@ -3466,7 +3472,8 @@
showToast("✓ Paramètres sauvegardés", "success");
} catch (err) {
console.error("Failed to save hidden files settings:", err);
showToast("Erreur de sauvegarde", "error");
const errorMsg = err.message || "Erreur inconnue";
showToast(`Erreur: ${errorMsg}`, "error");
} finally {
if (btn) { btn.disabled = false; btn.textContent = "💾 Sauvegarder"; }
}
@@ -3501,7 +3508,8 @@
await Promise.all([loadVaults(), loadTags()]);
} catch (err) {
console.error("Reindex with hidden files error:", err);
showToast("Erreur de réindexation", "error");
const errorMsg = err.message || "Erreur inconnue";
showToast(`Erreur: ${errorMsg}`, "error");
} finally {
if (btn) { btn.disabled = false; btn.textContent = "🔄 Réindexer"; }
}