pub enum Error {
Show 16 variants
Io(Error),
Http(Error),
DownloadFailed {
url: String,
reason: String,
},
InstallationFailed {
tool_name: String,
version: String,
message: String,
},
ExtractionFailed {
archive_path: PathBuf,
reason: String,
},
UnsupportedFormat {
format: String,
},
ExecutableNotFound {
tool_name: String,
search_path: PathBuf,
},
ChecksumMismatch {
file_path: PathBuf,
expected: String,
actual: String,
},
InvalidConfig {
message: String,
},
PermissionDenied {
path: PathBuf,
},
AlreadyInstalled {
tool_name: String,
version: String,
},
InsufficientSpace {
required: u64,
available: u64,
},
NetworkTimeout {
url: String,
},
Json(Error),
Walkdir(Error),
ToolSpecific {
message: String,
},
}Expand description
Error types that can occur during installation operations
Variants§
Io(Error)
IO error occurred
Http(Error)
HTTP request failed
DownloadFailed
Download failed
InstallationFailed
Installation failed
ExtractionFailed
Archive extraction failed
UnsupportedFormat
Unsupported archive format
ExecutableNotFound
Executable not found after installation
ChecksumMismatch
Checksum verification failed
InvalidConfig
Invalid configuration
PermissionDenied
Permission denied
AlreadyInstalled
Tool already installed
InsufficientSpace
Disk space insufficient
NetworkTimeout
Network timeout
Json(Error)
JSON parsing error
Walkdir(Error)
Walkdir error
ToolSpecific
Custom error for tool-specific issues
Implementations§
Source§impl Error
impl Error
Sourcepub fn download_failed(
url: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn download_failed( url: impl Into<String>, reason: impl Into<String>, ) -> Self
Create a download failed error
Sourcepub fn installation_failed(
tool_name: impl Into<String>,
version: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn installation_failed( tool_name: impl Into<String>, version: impl Into<String>, message: impl Into<String>, ) -> Self
Create an installation failed error
Sourcepub fn extraction_failed(
archive_path: impl Into<PathBuf>,
reason: impl Into<String>,
) -> Self
pub fn extraction_failed( archive_path: impl Into<PathBuf>, reason: impl Into<String>, ) -> Self
Create an extraction failed error
Sourcepub fn unsupported_format(format: impl Into<String>) -> Self
pub fn unsupported_format(format: impl Into<String>) -> Self
Create an unsupported format error
Sourcepub fn executable_not_found(
tool_name: impl Into<String>,
search_path: impl Into<PathBuf>,
) -> Self
pub fn executable_not_found( tool_name: impl Into<String>, search_path: impl Into<PathBuf>, ) -> Self
Create an executable not found error
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if this error is recoverable
Sourcepub fn is_network_error(&self) -> bool
pub fn is_network_error(&self) -> bool
Check if this error is related to network issues
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.