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
+14 -1
View File
@@ -1477,7 +1477,20 @@ async def api_update_vault_settings(vault_name: str, body: dict = Body(...), cur
settings_to_update["hiddenWhitelist"] = body["hiddenWhitelist"]
# Update persisted settings
updated = update_vault_setting(vault_name, settings_to_update)
try:
updated = update_vault_setting(vault_name, settings_to_update)
except PermissionError as e:
logger.error(f"Permission error saving settings for vault '{vault_name}': {e}")
raise HTTPException(
status_code=500,
detail=f"Permission denied: Cannot write to settings file. Check /app/data permissions."
)
except Exception as e:
logger.error(f"Error saving settings for vault '{vault_name}': {e}")
raise HTTPException(
status_code=500,
detail=f"Failed to save settings: {str(e)}"
)
# Update in-memory vault config
if vault_name in vault_config: