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:
+14
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user