From 1167b08e70b285b4293a6921a4ddb309b0c0be93 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 24 Feb 2026 13:13:48 +0100 Subject: [PATCH] fix: handle Begin() error in db.NewSession() instead of ignoring it --- pkg/db/db.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/db/db.go b/pkg/db/db.go index 13ee7e6ed..f48a6b65a 100644 --- a/pkg/db/db.go +++ b/pkg/db/db.go @@ -408,7 +408,9 @@ func WipeEverything() error { // s.Close() will auto-rollback any uncommitted transaction. func NewSession() *xorm.Session { s := x.NewSession() - _ = s.Begin() + if err := s.Begin(); err != nil { + log.Fatalf("Failed to begin database transaction: %s", err) + } return s }