summaryrefslogtreecommitdiffstats
path: root/deps_index/src/lib.rs
blob: 060bd0236aee8f9f966a7f7b40e1900a4dd22f04 (plain)
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
26
27
28
29
30
31
32
33
34
mod index;
use failure::Fail;
pub use index::*;
use rich_crate::Origin;
use std::path::PathBuf;

mod deps_stats;
mod git_crates_index;
pub use crates_index::Crate as CratesIndexCrate;
pub use crates_index::Version as CratesIndexVersion;
pub use deps_stats::*;

#[derive(Debug, Clone, Fail)]
pub enum DepsErr {
    #[fail(display = "crate not found: {:?}", _0)]
    CrateNotFound(Origin),
    #[fail(display = "crate {} not found in repo {}", _0, _1)]
    CrateNotFoundInRepo(String, String),
    #[fail(display = "crate is not a package: {:?}", _0)]
    NotAPackage(Origin),

    #[fail(display = "Error when parsing verison")]
    SemverParsingError,
    #[fail(display = "Stopped")]
    Stopped,
    #[fail(display = "Deps stats timeout")]
    DepsNotAvailable,
    #[fail(display = "Index is empty or parsing failed")]
    IndexBroken,
    #[fail(display = "Crate timeout")]
    GitIndexFile(PathBuf, String),
    #[fail(display = "Git crate '{:?}' can't be indexed, because it's not on the list", _0)]
    GitCrateNotAllowed(Origin),
}