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    /// Failed parsing the repository reference
44    #[error("Unable to parse repo reference: `{0}`")]
45    RepositoryReferenceError(String),
46
47    /// IO Error
48    #[error("IO Error: `{0}`")]
49    IOError(String),
50
51    /// Not Implemented
52    #[error("Not Implemented")]
53    NotImplemented,
54}