pub enum Error {
Show 15 variants
OpenScriptNotFound,
CommandFailed {
message: String,
},
Timeout {
duration: Duration,
},
ScriptWriteError {
source: Error,
},
ScriptReadError {
path: String,
source: Error,
},
InvalidScriptPath {
path: String,
reason: String,
},
InvalidWorkingDirectory {
path: String,
source: Error,
},
InvalidEnvironmentVariable {
key: String,
reason: String,
},
ProcessSpawnError {
source: Error,
},
ProcessWaitError {
source: Error,
},
OutputCaptureError {
source: Error,
},
PermissionDenied,
Interrupted {
signal: i32,
},
ResourceLimitExceeded {
resource: String,
limit: String,
},
IoError {
context: String,
source: Error,
},
}
Expand description
Errors that can occur when running OpenScript commands.
Variants§
OpenScriptNotFound
OpenScript executable was not found in PATH or at the specified location.
CommandFailed
A command failed to execute.
Timeout
The command timed out.
ScriptWriteError
Failed to write script content to temporary file.
ScriptReadError
Failed to read script file.
Fields
InvalidScriptPath
Invalid script path provided.
Fields
InvalidWorkingDirectory
Working directory does not exist or is not accessible.
Fields
InvalidEnvironmentVariable
Environment variable contains invalid characters.
Fields
ProcessSpawnError
Process spawning failed.
ProcessWaitError
Process wait failed.
OutputCaptureError
Output capture failed.
PermissionDenied
Permission denied when executing script.
Interrupted
Script execution was interrupted.
ResourceLimitExceeded
Resource limit exceeded during execution.
Fields
IoError
Generic I/O error with context.
Implementations§
Source§impl Error
impl Error
Sourcepub fn command_failed<S: Into<String>>(message: S) -> Self
pub fn command_failed<S: Into<String>>(message: S) -> Self
Create a new command failed error.
Sourcepub fn script_write_error(source: Error) -> Self
pub fn script_write_error(source: Error) -> Self
Create a new script write error.
Sourcepub fn script_read_error<S: Into<String>>(path: S, source: Error) -> Self
pub fn script_read_error<S: Into<String>>(path: S, source: Error) -> Self
Create a new script read error.
Sourcepub fn invalid_script_path<P: Into<String>, R: Into<String>>(
path: P,
reason: R,
) -> Self
pub fn invalid_script_path<P: Into<String>, R: Into<String>>( path: P, reason: R, ) -> Self
Create a new invalid script path error.
Sourcepub fn invalid_working_directory<P: Into<String>>(
path: P,
source: Error,
) -> Self
pub fn invalid_working_directory<P: Into<String>>( path: P, source: Error, ) -> Self
Create a new invalid working directory error.
Sourcepub fn invalid_environment_variable<K: Into<String>, R: Into<String>>(
key: K,
reason: R,
) -> Self
pub fn invalid_environment_variable<K: Into<String>, R: Into<String>>( key: K, reason: R, ) -> Self
Create a new invalid environment variable error.
Sourcepub fn process_spawn_error(source: Error) -> Self
pub fn process_spawn_error(source: Error) -> Self
Create a new process spawn error.
Sourcepub fn process_wait_error(source: Error) -> Self
pub fn process_wait_error(source: Error) -> Self
Create a new process wait error.
Sourcepub fn output_capture_error(source: Error) -> Self
pub fn output_capture_error(source: Error) -> Self
Create a new output capture error.
Sourcepub fn interrupted(signal: i32) -> Self
pub fn interrupted(signal: i32) -> Self
Create a new interrupted error.
Sourcepub fn resource_limit_exceeded<R: Into<String>, L: Into<String>>(
resource: R,
limit: L,
) -> Self
pub fn resource_limit_exceeded<R: Into<String>, L: Into<String>>( resource: R, limit: L, ) -> Self
Create a new resource limit exceeded error.
Sourcepub fn io_error<C: Into<String>>(context: C, source: Error) -> Self
pub fn io_error<C: Into<String>>(context: C, source: Error) -> Self
Create a new I/O error with context.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this error is retryable.
Sourcepub fn user_message(&self) -> String
pub fn user_message(&self) -> String
Get a user-friendly error message with suggestions.