Skip to content

Commit

Permalink
feat(psqlutil): use the error translator by default when opening a go…
Browse files Browse the repository at this point in the history
…rm db
  • Loading branch information
bradub committed Jan 10, 2025
1 parent dce7673 commit a751dd8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions psqlutil/psql_open.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ func GormOpen(
return nil, fmt.Errorf("open db: %w", err)
}

if err := db.Use(GORMErrorsPlugin{}); err != nil {
return nil, fmt.Errorf("use gorm errors plugin: %w", err)
}

return db, nil
}

Expand Down

0 comments on commit a751dd8

Please sign in to comment.