9b3405bf0e
Updates to `29c48fb9f3daa11bd02794edd55060d0b01ee705` from the `pubgrub-rs` dev branch. This lets us reduce the number of changes we've made to PubGrub itself (now, only changing visibility to export a few things from the `solver.rs` module).
35 lines
948 B
Rust
35 lines
948 B
Rust
use pubgrub::range::Range;
|
|
use thiserror::Error;
|
|
|
|
use pep508_rs::Requirement;
|
|
|
|
use crate::pubgrub::package::PubGrubPackage;
|
|
use crate::pubgrub::version::PubGrubVersion;
|
|
|
|
#[derive(Error, Debug)]
|
|
pub enum ResolveError {
|
|
#[error("Failed to find a version of {0} that satisfies the requirement")]
|
|
NotFound(Requirement),
|
|
|
|
#[error("The request stream terminated unexpectedly")]
|
|
StreamTermination,
|
|
|
|
#[error(transparent)]
|
|
Client(#[from] puffin_client::PypiClientError),
|
|
|
|
#[error(transparent)]
|
|
TrySend(#[from] futures::channel::mpsc::SendError),
|
|
|
|
#[error(transparent)]
|
|
Join(#[from] tokio::task::JoinError),
|
|
|
|
#[error(transparent)]
|
|
PubGrub(#[from] pubgrub::error::PubGrubError<PubGrubPackage, Range<PubGrubVersion>>),
|
|
}
|
|
|
|
impl<T> From<futures::channel::mpsc::TrySendError<T>> for ResolveError {
|
|
fn from(value: futures::channel::mpsc::TrySendError<T>) -> Self {
|
|
value.into_send_error().into()
|
|
}
|
|
}
|