objectiveai_sdk/filesystem/
error.rs1#[derive(Debug, thiserror::Error)]
2pub enum Error {
3 #[error("failed to read directory {0}: {1}")]
4 ReadDir(std::path::PathBuf, std::io::Error),
5 #[error("failed to read file {0}: {1}")]
6 Read(std::path::PathBuf, std::io::Error),
7 #[error("failed to parse file {0}: {1}")]
8 Parse(std::path::PathBuf, serde_json::Error),
9 #[error("failed to serialize: {0}")]
10 Serialize(serde_json::Error),
11 #[error("failed to write file {0}: {1}")]
12 Write(std::path::PathBuf, std::io::Error),
13 #[error("not found: {0}")]
14 NotFound(String),
15 #[error("invalid path: {0}")]
16 InvalidPath(String),
17 #[error("index {0} out of bounds (len {1})")]
18 IndexOutOfBounds(usize, usize),
19 #[error("favorite not found: {0}")]
20 FavoriteNotFound(String),
21 #[error("invalid favorite name (alphanumeric and dashes only, max 64 chars): {0}")]
22 InvalidFavoriteName(String),
23 #[error("invalid favorite note (max 512 chars): {0}")]
24 InvalidFavoriteNote(String),
25 #[error("remote {0:?} is not valid for configuration")]
26 InvalidRemote(crate::Remote),
27 #[error("jq parse error: {0}")]
28 JqParse(String),
29 #[error("jq compile error: {0}")]
30 JqCompile(String),
31 #[error("jq runtime error: {0}")]
32 JqRuntime(String),
33 #[error("invalid repository name (alphanumeric and dashes only, max 100 chars): {0}")]
34 InvalidRepositoryName(String),
35 #[error("io error: {0}")]
36 Io(#[from] std::io::Error),
37 #[error("git error: {0}")]
38 Git(#[from] git2::Error),
39 #[error("db error: {0}")]
40 Db(#[from] rusqlite::Error),
41 #[cfg(feature = "http")]
42 #[error("plugin install error: {0}")]
43 Install(#[from] crate::filesystem::plugins::InstallError),
44}