From 03d4e7e6acb32b39221cd9086e2bc3a4003fa6ea Mon Sep 17 00:00:00 2001 From: moein Date: Mon, 5 May 2025 15:05:37 +0330 Subject: [PATCH] fix: handle error --- finisher_api.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/finisher_api.go b/finisher_api.go index bb298c3d..a466a67c 100644 --- a/finisher_api.go +++ b/finisher_api.go @@ -181,7 +181,10 @@ func (db *DB) Only(dest interface{}, conds ...interface{}) (tx *DB) { } if count > 1 { - findTx.AddError(ErrMultipleRecordsFound) + err := findTx.AddError(ErrMultipleRecordsFound) + if err != nil { + return nil + } } return findTx