pub enum CrateCheckerError {
Show 18 variants
HttpError(Error),
JsonError(Error),
YamlError(Error),
ConfigError(ConfigError),
IoError(Error),
CrateNotFound(String),
VersionNotFound {
crate_name: String,
version: String,
},
InvalidCrateName(String, &'static str),
RateLimitExceeded,
ServerError {
status: u16,
message: String,
},
Timeout(u64),
BatchError(String),
InvalidBatchInput(String),
ValidationError(String),
ApplicationError(String),
NetworkError(String),
AuthError(String),
ServiceUnavailable(String),
}Expand description
Main error type for the crate checker application
Variants§
HttpError(Error)
HTTP request failed
JsonError(Error)
JSON serialization/deserialization failed
YamlError(Error)
YAML serialization/deserialization failed
ConfigError(ConfigError)
Configuration error
IoError(Error)
IO operation failed
CrateNotFound(String)
Crate not found
VersionNotFound
Version not found
InvalidCrateName(String, &'static str)
Invalid crate name
RateLimitExceeded
API rate limit exceeded
ServerError
Server error from crates.io API
Timeout(u64)
Timeout error
BatchError(String)
Batch processing error
InvalidBatchInput(String)
Invalid batch input
ValidationError(String)
Validation error
ApplicationError(String)
Generic application error
NetworkError(String)
Network connectivity error
AuthError(String)
Authentication error
Service unavailable
Implementations§
Source§impl CrateCheckerError
impl CrateCheckerError
Sourcepub fn application<S: Into<String>>(message: S) -> Self
pub fn application<S: Into<String>>(message: S) -> Self
Create a new application error
Sourcepub fn validation<S: Into<String>>(message: S) -> Self
pub fn validation<S: Into<String>>(message: S) -> Self
Create a new validation error
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if this error is recoverable (i.e., worth retrying)
Sourcepub fn status_code(&self) -> Option<u16>
pub fn status_code(&self) -> Option<u16>
Get the HTTP status code if this error represents an HTTP error
Sourcepub fn user_message(&self) -> String
pub fn user_message(&self) -> String
Convert to a user-friendly message
Trait Implementations§
Source§impl Debug for CrateCheckerError
impl Debug for CrateCheckerError
Source§impl Display for CrateCheckerError
impl Display for CrateCheckerError
Source§impl Error for CrateCheckerError
impl Error for CrateCheckerError
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()
Source§impl From<ConfigError> for CrateCheckerError
impl From<ConfigError> for CrateCheckerError
Source§fn from(source: ConfigError) -> Self
fn from(source: ConfigError) -> Self
Source§impl From<CrateCheckerError> for AppError
impl From<CrateCheckerError> for AppError
Source§fn from(err: CrateCheckerError) -> Self
fn from(err: CrateCheckerError) -> Self
Source§impl From<Error> for CrateCheckerError
impl From<Error> for CrateCheckerError
Source§impl From<Error> for CrateCheckerError
impl From<Error> for CrateCheckerError
Source§impl From<Error> for CrateCheckerError
impl From<Error> for CrateCheckerError
Source§impl From<Error> for CrateCheckerError
impl From<Error> for CrateCheckerError
Source§impl From<StatusCode> for CrateCheckerError
Convert reqwest status codes to appropriate errors
impl From<StatusCode> for CrateCheckerError
Convert reqwest status codes to appropriate errors