From dc0c75a0a734a74c8347c59aad1936e669ca11fd Mon Sep 17 00:00:00 2001 From: Daniel Hochman Date: Tue, 4 Jan 2022 11:52:39 -0600 Subject: [PATCH] Add missing err returns (#2250) * 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. --- tools/sql/handler.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/sql/handler.go b/tools/sql/handler.go index f5ac97b68a6..bace5ab3bd5 100644 --- a/tools/sql/handler.go +++ b/tools/sql/handler.go @@ -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 { @@ -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 }