sstadick / perbase

Per-base per-nucleotide depth analysis
MIT License
115 stars 13 forks source link

Better error message with an invalid bed file #42

Closed nh13 closed 2 years ago

nh13 commented 2 years ago

If the end is before the start in a BED file, I get this error:

thread '<unnamed>' panicked at 'Fetched a region: Fetch', src/commands/base_depth.rs:212:42
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: rayon::iter::plumbing::bridge_producer_consumer::helper
   4: rayon_core::join::join_context::{{closure}}
   5: perbase_lib::par_granges::ParGranges<R>::process::{{closure}}::{{closure}}
   6: <rayon_core::job::StackJob<L,F,R> as rayon_core::job::Job>::execute
   7: rayon_core::registry::WorkerThread::wait_until_cold
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

A better error message would be helpful!