Skip to content

Find, verify, and analyze leaked credentials

no panic (#3966)

ahrav21fbe08b7245
diff --git a/pkg/detectors/snowflake/snowflake.go b/pkg/detectors/snowflake/snowflake.go
index 189c30708..aa2438829 100644
--- a/pkg/detectors/snowflake/snowflake.go
+++ b/pkg/detectors/snowflake/snowflake.go
@@ -107,8 +107,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 {
- // sql.Open() only errors if unable to import the snowflake driver, in which case we should panic.
- panic(err)
+ return nil, err
}
defer db.Close()