Skip to content

Commit

Permalink
fix: Handle errors during version scan
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentinchampenois committed Sep 14, 2024
1 parent 5c46815 commit 1bd3b80
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/pkg/dbx/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ func getPendingMigrations(versions []int) ([]int, error) {

for rows.Next() {
var version int
_ = rows.Scan(&version)
if err := rows.Scan(&version); err != nil {
return nil, errors.Wrap(err, "failed to scan version")
}
i := slices.Index(pendingMigrations, version)
if i != -1 {
pendingMigrations = slices.Delete(pendingMigrations, i, i+1)
Expand Down

0 comments on commit 1bd3b80

Please sign in to comment.