crate_index/
error.rs

1use crate::validate;
2use std::io;
3
4/// This [`Error`] represents anything that can go wrong with this library
5#[derive(Debug, thiserror::Error)]
6pub enum Error {
7    /// Metadata validation error
8    #[error("Validation Error")]
9    Validation(#[from] validate::Error),
10
11    /// filesystem IO error
12    #[error("IO Error")]
13    Io(#[from] io::Error),
14
15    /// libgit2 error
16    #[error("Git Error")]
17    Git(#[from] git2::Error),
18
19    /// requested crate data not found
20    #[error("Not Found Error")]
21    NotFound,
22}
23
24/// The result type for fallible functions in this library
25pub type Result<T> = std::result::Result<T, Error>;