git_bot_feedback/
error.rs1use thiserror::Error;
3
4use crate::OutputVariable;
5
6#[derive(Debug, Error)]
8pub enum RestClientError {
9 #[error("{0}")]
11 Request(#[from] reqwest::Error),
12
13 #[error("{0}")]
15 Io(#[from] std::io::Error),
16
17 #[error("Git command error: {0}")]
19 #[cfg(feature = "file-changes")]
20 #[cfg_attr(docsrs, doc(cfg(feature = "file-changes")))]
21 GitCommandError(String),
22
23 #[error("Rate Limit exceeded")]
25 RateLimit,
26
27 #[error("Failed to clone request object for auto-reties")]
29 RequestCloneError,
30
31 #[error("Tried to create a header value from invalid string data")]
33 InvalidHeaderValue(#[from] reqwest::header::InvalidHeaderValue),
34
35 #[error("{0}")]
37 UrlParseError(#[from] url::ParseError),
38
39 #[error("{0}")]
41 JsonError(#[from] serde_json::Error),
42
43 #[error("{0}")]
45 EnvVarError(#[from] std::env::VarError),
46
47 #[error("OutputVariable is malformed: {0}")]
49 OutputVarError(OutputVariable),
50}
51
52#[cfg(feature = "file-changes")]
54#[derive(Debug, Error)]
55#[cfg_attr(docsrs, doc(cfg(feature = "file-changes")))]
56pub enum DirWalkError {
57 #[error("Failed to read directory {0}: {1}")]
58 ReadDirError(String, std::io::Error),
59}