#[non_exhaustive]pub enum Error {
Io(Error),
UnavailableFileCommand {
var: &'static str,
operation: &'static str,
},
MissingEnvFile {
var: &'static str,
path: PathBuf,
},
DelimiterCollision,
ReservedName(String),
InvalidBool {
name: String,
value: String,
},
MissingRequiredInput(String),
ParseInput {
name: String,
reason: String,
},
SummaryTooLarge {
bytes: usize,
},
InvalidName {
name: String,
reason: &'static str,
},
}Expand description
Errors produced by fallible actions-rs operations.
#[non_exhaustive] so new variants can be added without a breaking change.
§Examples
use actions_rs::Error;
// Reserved names are rejected before any write happens.
let err = actions_rs::output::export_var("GITHUB_TOKEN", "x").unwrap_err();
assert!(matches!(err, Error::ReservedName(_)));
// `Display` is human-readable.
assert!(err.to_string().contains("reserved"));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
An underlying I/O error while reading or appending an environment file.
The runner did not provide the required environment-file path for an operation whose stdout command fallback has been retired.
MissingEnvFile
The environment-file variable pointed at a path that does not exist.
GitHub sets these (GITHUB_ENV, GITHUB_OUTPUT, …) to a real file;
if the variable is present but the file is missing the runner state is
broken and we surface it rather than silently dropping the write.
Fields
DelimiterCollision
The randomly generated heredoc delimiter collided with the key or value
being written. Astronomically unlikely; retrying will pick a fresh
delimiter. Mirrors @actions/core, which also errors in this case.
ReservedName(String)
Attempted to export a reserved variable via crate::output::export_var
(GITHUB_*, RUNNER_*, or NODE_OPTIONS). The runner forbids this.
InvalidBool
A boolean input did not match the strict YAML 1.2 core schema
(true|True|TRUE|false|False|FALSE).
MissingRequiredInput(String)
A required input was absent or empty.
ParseInput
A typed input could not be parsed into the requested type.
Fields
SummaryTooLarge
The job summary buffer exceeded GitHub’s 1 MiB per-step limit.
InvalidName
A key or path contained a carriage return or line feed, which would corrupt the line-oriented environment-file syntax (and could inject extra entries). Rejected before anything is written.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()