pub enum ArchToolkitError {
Show 14 variants
Network(Error),
SearchFailed {
query: String,
source: Error,
},
InfoFailed {
packages: String,
source: Error,
},
CommentsFailed {
package: String,
source: Error,
},
PkgbuildFailed {
package: String,
source: Error,
},
Json(Error),
Parse(String),
RateLimited {
retry_after: Option<u64>,
},
PackageNotFound {
package: String,
},
InvalidInput(String),
EmptyInput {
field: String,
message: String,
},
InvalidPackageName {
name: String,
reason: String,
},
InvalidSearchQuery {
reason: String,
},
InputTooLong {
field: String,
max_length: usize,
actual_length: usize,
},
}Expand description
Unified error type for all arch-toolkit operations.
This error type covers all possible failure modes across different modules, providing clear, actionable error messages.
Variants§
Network(Error)
Network or HTTP request error.
Note: For AUR operations, prefer using operation-specific error variants
(SearchFailed, InfoFailed, CommentsFailed, PkgbuildFailed) to preserve context.
This variant is retained for client initialization and non-AUR operations.
SearchFailed
AUR search operation failed.
InfoFailed
AUR info fetch operation failed.
Fields
CommentsFailed
AUR comments fetch operation failed.
PkgbuildFailed
PKGBUILD fetch operation failed.
Json(Error)
JSON parsing error.
Parse(String)
Custom parsing error with message.
RateLimited
Rate limiting error with optional retry-after information.
PackageNotFound
Package not found (enhanced with package name).
InvalidInput(String)
Invalid input parameter.
EmptyInput
Empty input provided where a value is required.
Fields
InvalidPackageName
Package name contains invalid characters or format.
InvalidSearchQuery
Search query validation failed.
InputTooLong
Input exceeds maximum length.
Implementations§
Source§impl ArchToolkitError
impl ArchToolkitError
Sourcepub fn search_failed(query: impl Into<String>, source: Error) -> Self
pub fn search_failed(query: impl Into<String>, source: Error) -> Self
What: Create a SearchFailed error with query context.
Inputs:
query: The search query that failedsource: The underlying network error
Output:
ArchToolkitError::SearchFailedvariant
Details:
- Convenience constructor for search operation errors
- Preserves both the query and the underlying error
Sourcepub fn info_failed(packages: &[&str], source: Error) -> Self
pub fn info_failed(packages: &[&str], source: Error) -> Self
What: Create an InfoFailed error with package names context.
Inputs:
packages: Slice of package names that failedsource: The underlying network error
Output:
ArchToolkitError::InfoFailedvariant
Details:
- Convenience constructor for info operation errors
- Formats package names as comma-separated string
- Preserves both the package names and the underlying error
Sourcepub fn comments_failed(package: impl Into<String>, source: Error) -> Self
pub fn comments_failed(package: impl Into<String>, source: Error) -> Self
What: Create a CommentsFailed error with package name context.
Inputs:
package: The package name that failedsource: The underlying network error
Output:
ArchToolkitError::CommentsFailedvariant
Details:
- Convenience constructor for comments operation errors
- Preserves both the package name and the underlying error
Sourcepub fn pkgbuild_failed(package: impl Into<String>, source: Error) -> Self
pub fn pkgbuild_failed(package: impl Into<String>, source: Error) -> Self
What: Create a PkgbuildFailed error with package name context.
Inputs:
package: The package name that failedsource: The underlying network error
Output:
ArchToolkitError::PkgbuildFailedvariant
Details:
- Convenience constructor for pkgbuild operation errors
- Preserves both the package name and the underlying error
Trait Implementations§
Source§impl Debug for ArchToolkitError
impl Debug for ArchToolkitError
Source§impl Display for ArchToolkitError
impl Display for ArchToolkitError
Source§impl Error for ArchToolkitError
impl Error for ArchToolkitError
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
Auto Trait Implementations§
impl Freeze for ArchToolkitError
impl !RefUnwindSafe for ArchToolkitError
impl Send for ArchToolkitError
impl Sync for ArchToolkitError
impl Unpin for ArchToolkitError
impl !UnwindSafe for ArchToolkitError
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
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.