Skip to content

Commit

Permalink
panic if gosnowflake not imported correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
zubairk14 committed Aug 23, 2023
1 parent 88fcc9f commit c223aba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/detectors/snowflake/snowflake.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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()

Expand Down

0 comments on commit c223aba

Please sign in to comment.