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:
+10
-2
@@ -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"; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user