pub enum PypiError {
TomlParseError {
source: TomlError,
},
InvalidVersionSpecifier {
specifier: String,
source: VersionSpecifiersParseError,
},
InvalidDependencySpec {
source: Pep508Error,
},
PackageNotFound {
package: String,
},
RegistryError {
package: String,
source: Box<dyn Error + Send + Sync>,
},
ApiResponseError {
package: String,
source: Error,
},
UnsupportedFormat {
message: String,
},
MissingField {
section: String,
field: String,
},
CacheError(String),
Other(Box<dyn Error + Send + Sync>),
}Expand description
Errors specific to PyPI/Python dependency handling.
These errors cover parsing pyproject.toml files, validating PEP 440/508 specifications, and communicating with the PyPI registry.
Variants§
TomlParseError
Failed to parse pyproject.toml
Fields
§
source: TomlErrorInvalidVersionSpecifier
Invalid PEP 440 version specifier
InvalidDependencySpec
Invalid PEP 508 dependency specification
Fields
§
source: Pep508ErrorPackageNotFound
Package not found on PyPI
RegistryError
PyPI registry request failed
ApiResponseError
Failed to deserialize PyPI API response
UnsupportedFormat
Unsupported dependency format
MissingField
Missing required field in pyproject.toml
CacheError(String)
Cache error
Other(Box<dyn Error + Send + Sync>)
Generic error wrapper
Implementations§
Source§impl PypiError
impl PypiError
Sourcepub fn registry_error(
package: impl Into<String>,
error: impl Error + Send + Sync + 'static,
) -> Self
pub fn registry_error( package: impl Into<String>, error: impl Error + Send + Sync + 'static, ) -> Self
Create a registry error from any error type.
Sourcepub fn api_response_error(package: impl Into<String>, error: Error) -> Self
pub fn api_response_error(package: impl Into<String>, error: Error) -> Self
Create an API response error.
Sourcepub fn unsupported_format(message: impl Into<String>) -> Self
pub fn unsupported_format(message: impl Into<String>) -> Self
Create an unsupported format error.
Trait Implementations§
Source§impl Error for PypiError
impl Error for PypiError
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 PypiError
impl !RefUnwindSafe for PypiError
impl Send for PypiError
impl Sync for PypiError
impl Unpin for PypiError
impl !UnwindSafe for PypiError
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.