Skip to content

Commit

Permalink
Add missing err returns (#2250)
Browse files Browse the repository at this point in the history
* There were two instances I found in temporal-sql-tool where an error was logged but not returned, causing execution to continue erroneously and ultimately panic.
  • Loading branch information
danielhochman authored Jan 4, 2022
1 parent 4d9faa2 commit dc0c75a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/sql/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func updateSchema(cli *cli.Context, logger log.Logger) error {
conn, err := NewConnection(cfg)
if err != nil {
logger.Error("Unable to connect to SQL database.", tag.Error(err))
return err
}
defer conn.Close()
if err := schema.Update(cli, conn, logger); err != nil {
Expand Down Expand Up @@ -125,6 +126,7 @@ func dropDatabase(cli *cli.Context, logger log.Logger) error {
err = DoDropDatabase(cfg, database)
if err != nil {
logger.Error("Unable to drop SQL database.", tag.Error(err))
return err
}
return nil
}
Expand Down

0 comments on commit dc0c75a

Please sign in to comment.