loadsmith_thunderstore/
error.rs1use std::path::PathBuf;
2
3#[derive(Debug, thiserror::Error)]
18pub enum Error {
19 #[error("I/O error")]
20 Io(#[from] std::io::Error),
21
22 #[error("zip error")]
23 Zip(#[from] zip::result::ZipError),
24
25 #[error("YAML error")]
26 Yaml(#[from] serde_yaml_ng::Error),
27
28 #[error("JSON error")]
29 Json(#[from] serde_json::Error),
30
31 #[error("SQLite error")]
32 Sqlite(#[from] rusqlite::Error),
33
34 #[error("glob error")]
35 Glob(#[from] globset::Error),
36
37 #[error("thunderstore client error")]
38 Thunderstore(#[from] thunderstore::Error),
39
40 #[error("non UTF-8 path: {0}")]
41 NonUtf8Path(PathBuf),
42
43 #[error("profile manifest not found in zip archive")]
44 ProfileManifestNotFound,
45
46 #[error("invalid zip file path: {0}")]
47 InvalidZipFilePath(PathBuf),
48
49 #[error("invalid thunderstore identifier: {0}")]
50 InvalidIdent(thunderstore::Error),
51
52 #[error("index is not built")]
53 IndexNotComplete,
54
55 #[error("distribution is missing identifier")]
56 DistributionIsMissingIdentifier,
57
58 #[error("invalid steam id")]
59 InvalidSteamId(#[source] std::num::ParseIntError),
60
61 #[error("unsupported tracking method: {0:?}")]
62 UnsupportedTrackingMethod(thunderstore::models::schema::TrackingMethod),
63
64 #[error("unsupported loader: {0:?}")]
65 UnsupportedLoader(thunderstore::models::schema::Loader),
66
67 #[error("unsupported platform: {0:?}")]
68 UnsupportedPlatform(thunderstore::models::schema::Platform),
69}
70
71pub type Result<T> = std::result::Result<T, Error>;