Skip to content

Commit e733629

Browse files
committed
faidx: more precise errors, better string handling
1 parent 1bd4027 commit e733629

2 files changed

Lines changed: 126 additions & 158 deletions

File tree

src/errors.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,8 @@ pub enum Error {
3131
WriteRecord,
3232

3333
// Errors for faidx
34-
#[error("The given position is too large to be converted to i64")]
35-
FaidxPositionTooLarge,
36-
#[error("bad conversion of sequence name")]
37-
FaidxBadSeqName,
38-
#[error("failed to build index for fasta file {path:?}")]
39-
FaidxBuildFailed { path: std::path::PathBuf },
40-
#[error("failed to open FASTA/FAI")]
41-
FaidxOpenError,
42-
#[error("failed to fetch sequence {name}:{begin}-{end}")]
43-
FaidxFetchFailed {
44-
name: String,
45-
begin: usize,
46-
end: usize,
47-
},
34+
#[error(transparent)]
35+
Faidx(#[from] crate::faidx::FaidxError),
4836

4937
// Errors for Tbx
5038
#[error("previous iterator generation failed")]

0 commit comments

Comments
 (0)