Skip to content

Commit

Permalink
wrap errs
Browse files Browse the repository at this point in the history
  • Loading branch information
safeer committed Aug 14, 2024
1 parent 4d71ab2 commit 383ac00
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/controller/sql/databasetesting/devel.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func CreateForDevel(ctx context.Context, dsn string, recreate bool) (*stdsql.DB,

realConn, err := stdsql.Open("pgx", dsn)
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to open database: %w", err)
}
// Reset transient state in the database to a clean state for development purposes.
// This includes things like resetting the state of async calls, leases,
Expand Down
2 changes: 1 addition & 1 deletion internal/modulecontext/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Database struct {
func NewDatabase(dbType DBType, dsn string) (Database, error) {
db, err := sql.Open("pgx", dsn)
if err != nil {
return Database{}, err
return Database{}, fmt.Errorf("failed to bring up DB connection: %w", err)
}
return Database{
DSN: dsn,
Expand Down

0 comments on commit 383ac00

Please sign in to comment.