dont overwrite original error

This commit is contained in:
Elio Bischof 2023-07-04 17:31:07 +02:00
parent 8e8730d017
commit 227c63a89d
No known key found for this signature in database
GPG Key ID: 7B383FDE4DDBF1BD

View File

@ -85,8 +85,8 @@ func (q *Queries) SearchMilestones(ctx context.Context, instanceIDs []string, qu
return nil, err return nil, err
} }
defer func() { defer func() {
if err = rows.Close(); err != nil { if closeErr := rows.Close(); closeErr != nil && err == nil {
err = errors.ThrowInternal(err, "QUERY-CK9mI", "Errors.Query.CloseRows") err = errors.ThrowInternal(closeErr, "QUERY-CK9mI", "Errors.Query.CloseRows")
} }
}() }()
milestones, err := scan(rows) milestones, err := scan(rows)