Add error messages for the case in which the database initialization fails (#415)

This commit is contained in:
Xinyu Bao
2025-08-05 23:11:11 +08:00
committed by GitHub
parent c7978e20da
commit 5537c621be

View File

@@ -28,7 +28,7 @@ async fn migrate_database() -> Result<()> {
pub async fn setup_database() -> Result<DatabaseConnection> {
tokio::fs::create_dir_all(CONFIG_DIR.as_path())
.await
.context("Failed to create config directory")?;
.context("Failed to create config directory. Please check if you have granted necessary permissions to your folder.")?;
migrate_database().await.context("Failed to migrate database")?;
database_connection().await.context("Failed to connect to database")
}