Skip to content

Commit ecda7df

Browse files
committed
propagate build_sds_scanner error instead of panicking
1 parent 508adb1 commit ecda7df

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

crates/bins/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ pub fn secret_analysis(
267267
files_to_analyze: &[PathBuf],
268268
) -> anyhow::Result<AnalysisResult<SecretResult>> {
269269
let secrets_rules = &config.secrets_rules;
270-
let sds_scanner = build_sds_scanner(secrets_rules, config.use_debug)
271-
.expect("error when instantiating the scanner");
270+
let sds_scanner =
271+
build_sds_scanner(secrets_rules, config.use_debug).map_err(|e| anyhow::anyhow!(e))?;
272272

273273
let nb_secrets_files = files_to_analyze.len();
274274
let directory_path = Path::new(config.source_directory.as_str());

0 commit comments

Comments
 (0)