Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing bam/cram file should return an error code #57

Open
patbohn opened this issue Sep 29, 2022 · 2 comments
Open

Missing bam/cram file should return an error code #57

patbohn opened this issue Sep 29, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@patbohn
Copy link

patbohn commented Sep 29, 2022

Hi, when running perbase base-depth with an incorrect BAM/CRAM path, even though stderr reports thread '<unnamed>' panicked at 'Indexed BAM/CRAM: FileNotFound [...] perbase/src/lib/par_granges.rs:159:72, it seems that no error code was returned (i.e. it apparently returned 0). This can be an issue when using pipeline or workload managers.

@sstadick
Copy link
Owner

Thanks for making this issue! I look into it and get an update out in the near future. That is definitely not the desired behavior, it should exit > 0.👍

@sstadick sstadick added the bug Something isn't working label Sep 29, 2022
@nano-pat
Copy link

nano-pat commented Jun 27, 2024

Small bump - I think what's happening here is that while you're catching any Error returned here:

if let Err(err) = Args::from_args().subcommand.run() {

A missing file will not return an Error, but just panic due to the .expect() call here:

let mut reader = IndexedReader::from_path(&self.reads).expect("Indexed BAM/CRAM");

For the specific call in granges I suppose returning the Error early should work as the output of the process_region function is already a Result type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants