From 22cae16e00a961baf3f439cd20a2f95d38853397 Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Sun, 1 Dec 2024 14:49:01 +1300 Subject: [PATCH] Fix error handling --- internal/storage/search.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/storage/search.go b/internal/storage/search.go index fc4602569..62137693e 100644 --- a/internal/storage/search.go +++ b/internal/storage/search.go @@ -190,15 +190,15 @@ func DeleteSearch(search, timezone string) error { } } - err = tx.Commit() + if err := tx.Commit(); err != nil { + return err + } if err := pruneUnusedTags(); err != nil { return err } - if err == nil { - logger.Log().Debugf("[db] deleted %d messages matching %s", total, search) - } + logger.Log().Debugf("[db] deleted %d messages matching %s", total, search) dbLastAction = time.Now()