Skip to content

Commit 8b29fde

Browse files
committed
fix: only close database connection if exception is not related to linkora db not existing
1 parent ad6cf55 commit 8b29fde

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/main/kotlin/com/sakethh/linkora/data/Database.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ fun configureDatabase() {
2626
}
2727
println("Linkora database is operational and accessible.")
2828
} catch (e: Exception) {
29-
database.connector().close()
29+
30+
if (e.message != "Unknown database 'linkora'") {
31+
database.connector().close()
32+
}
3033

3134
if (e.message.toString().contains("requires autoCommit to be enabled")) {
3235
println("Enabling `autoCommit` as the database connected to requires it.")

0 commit comments

Comments
 (0)