Skip to content

Commit 2755aa5

Browse files
committed
Return a non-0 exit code in case of errors that should not be ignored
See also #838
1 parent 0d91efa commit 2755aa5

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

src/lib.rs

+7-14
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ pub fn consumer(
189189
ItemType::Path((stem, gcno_path)) => {
190190
// GCC
191191
if let Err(e) = run_gcov(&gcno_path, branch_enabled, working_dir) {
192-
error!("Error when running gcov: {}", e);
193-
continue;
192+
panic!("Error when running gcov: {}", e);
194193
};
195194
let gcov_ext = get_gcov_output_ext();
196195
let gcov_path =
@@ -266,19 +265,16 @@ pub fn consumer(
266265
}
267266
}
268267
ItemType::Content(_) => {
269-
error!("Invalid content type");
270-
continue;
268+
panic!("Invalid content type");
271269
}
272270
ItemType::Paths(_) => {
273-
error!("Invalid content type");
274-
continue;
271+
panic!("Invalid content type");
275272
}
276273
}
277274
}
278275
ItemFormat::Profraw => {
279276
if binary_path.is_none() {
280-
error!("The path to the compiled binary must be given as an argument when source-based coverage is used");
281-
continue;
277+
panic!("The path to the compiled binary must be given as an argument when source-based coverage is used");
282278
}
283279

284280
if let ItemType::Paths(profraw_paths) = work_item.item {
@@ -300,13 +296,11 @@ pub fn consumer(
300296
new_results
301297
}
302298
Err(e) => {
303-
error!("Error while executing llvm tools: {}", e);
304-
continue;
299+
panic!("Error while executing llvm tools: {}", e);
305300
}
306301
}
307302
} else {
308-
error!("Invalid content type");
309-
continue;
303+
panic!("Invalid content type");
310304
}
311305
}
312306
ItemFormat::Info | ItemFormat::JacocoXml => {
@@ -318,8 +312,7 @@ pub fn consumer(
318312
try_parse!(parse_jacoco_xml_report(buffer), work_item.name)
319313
}
320314
} else {
321-
error!("Invalid content type");
322-
continue;
315+
panic!("Invalid content type");
323316
}
324317
}
325318
};

0 commit comments

Comments
 (0)