From c223aba74837281ac0863f99843b0d517dba7782 Mon Sep 17 00:00:00 2001 From: Zubair Khan Date: Wed, 23 Aug 2023 16:50:10 -0400 Subject: [PATCH] panic if gosnowflake not imported correctly --- pkg/detectors/snowflake/snowflake.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/detectors/snowflake/snowflake.go b/pkg/detectors/snowflake/snowflake.go index c7bcbc4221f6..c2188540d808 100644 --- a/pkg/detectors/snowflake/snowflake.go +++ b/pkg/detectors/snowflake/snowflake.go @@ -104,7 +104,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result // Open a connection to Snowflake db, err := sql.Open("snowflake", uri) // Needs the snowflake driver from gosnowflake if err != nil { - s1.VerificationError = fmt.Errorf("unable to open a connection to Snowflake %+v", err) + panic(err) } defer db.Close() @@ -123,6 +123,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result rows, err := db.Query(retrieveAllDatabasesQuery) if err != nil { s1.VerificationError = fmt.Errorf("unable to query Snowflake to enrich secret ExtraData %+v", err) + continue } defer rows.Close()