Skip to content

Commit

Permalink
add error handlings to fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
stehessel committed Jan 11, 2023
1 parent ceebbaa commit 27db7d2
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,14 @@ func addOrganisationNameToCentralRequest(ocmConfig *ocm.OCMConfig) *gormigrate.M
}

rows, err := tx.Model(&CentralRequest{}).Where("organisation_name IS NULL").Rows()
defer rows.Close()
if err != nil {
return errors.Wrapf(err, "fetching rows where organisation_name is NULL in migration %s", id)
}
defer func() {
if err := rows.Close(); err != nil {
panic(errors.Wrapf(err, "closing rows in migration %s", id))
}
}()

for rows.Next() {
var central CentralRequest
Expand Down

0 comments on commit 27db7d2

Please sign in to comment.