ghactions_core/
errors.rs

1//! Errors for the core library
2use thiserror::Error;
3
4/// Actions Error
5#[derive(Error, Debug)]
6pub enum ActionsError {
7    /// Failed to load the environment
8    #[error("Failed to load environment: `{0}`")]
9    FailedLoading(String),
10
11    /// Failed to get input value from environment
12    #[error("Failed to get input value: `{0}`")]
13    InputError(String),
14
15    /// Input Type Error
16    #[error("Input Type Error: `{0}` (Expected: `{1}`)")]
17    InputTypeError(String, String),
18
19    /// IO Error
20    #[error("{0}")]
21    IoError(#[from] std::io::Error),
22
23    /// Tool Cache Error
24    #[cfg(feature = "toolcache")]
25    #[error("Tool Cache Error: `{0}`")]
26    ToolCacheError(String),
27
28    /// Tool Not Found in Cache
29    #[cfg(feature = "toolcache")]
30    #[error("Tool Not Found in Cache: `{0}`")]
31    ToolNotFound(String),
32
33    /// Glob Error
34    #[cfg(feature = "toolcache")]
35    #[error("Glob Pattern Error")]
36    PatternError(#[from] glob::PatternError),
37
38    /// Octocrab Error
39    #[cfg(feature = "octocrab")]
40    #[error("Octocrab Error: `{0}`")]
41    OctocrabError(String),
42
43    /// HTTP Header Error
44    #[cfg(feature = "toolcache")]
45    #[error("HTTP Header Error: `{0}`")]
46    HeaderError(#[from] http::header::InvalidHeaderValue),
47
48    /// Reqwest Error
49    #[cfg(feature = "toolcache")]
50    #[error("HTTP Error: `{0}`")]
51    ReqwestError(#[from] reqwest::Error),
52
53    /// Failed parsing the repository reference
54    #[error("Unable to parse repo reference: `{0}`")]
55    RepositoryReferenceError(String),
56
57    /// IO Error
58    #[error("IO Error: `{0}`")]
59    IOError(String),
60
61    /// Not Implemented
62    #[error("Not Implemented")]
63    NotImplemented,
64}