1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use snafu::Snafu;
use std::path::PathBuf;

pub type Result<T, E = Error> = std::result::Result<T, E>;

#[derive(Snafu, Debug, PartialEq)]
#[snafu(visibility = "pub")]
pub enum Error {
    #[snafu(display("previous iterator generation failed"))]
    NoIter,
    #[snafu(display("truncated tabix record"))]
    TruncatedRecord,
    #[snafu(display("invalid tabix index"))]
    InvalidIndex,
    #[snafu(display("file not found: {}", path.display()))]
    FileNotFound { path: PathBuf },
    #[snafu(display("invalid (non-unique) characters in path"))]
    NonUnicodePath,
    #[snafu(display("sequence {} not found in tabix index", sequence))]
    UnknownSequence { sequence: String },
    #[snafu(display("failed to fetch region in tabix index"))]
    Fetch,
    #[snafu(display("error setting threads for for tabix file reading"))]
    SetThreads,
}