add a input area for arbitrary SQL on the test page

This commit is contained in:
2025-05-25 20:27:06 -06:00
parent bea5f78171
commit 28b24f6c5d
2 changed files with 63 additions and 4 deletions

View File

@@ -144,9 +144,8 @@ export async function updateDefaultSettings(
// console.log("Database version:", db.verno);
await safeOpenDatabase();
} catch (openError: unknown) {
console.error("Failed to open database:", openError);
const errorMessage = openError instanceof Error ? openError.message : String(openError);
throw new Error(`Database connection failed: ${errorMessage}. Please try again or restart the app.`);
console.error("Failed to open database:", openError, String(openError));
throw new Error(`The database connection failed. We recommend you try again or restart the app.`);
}
const result = await db.settings.update(MASTER_SETTINGS_KEY, settingsChanges);
return result;
@@ -155,7 +154,7 @@ export async function updateDefaultSettings(
if (error instanceof Error) {
throw error; // Re-throw if it's already an Error with a message
} else {
throw new Error(`Failed to update settings: ${error}`);
throw new Error(`Failed to update settings. We recommend you try again or restart the app.`);
}
}
}