mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-15 15:16:37 +00:00
Add fetcher check error to debug log
This commit is contained in:
parent
856728b2c7
commit
6db14362ac
1 changed files with 5 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
pub use gh_crate_meta::*;
|
pub use gh_crate_meta::*;
|
||||||
|
pub use log::debug;
|
||||||
pub use quickinstall::*;
|
pub use quickinstall::*;
|
||||||
|
|
||||||
use crate::{PkgFmt, PkgMeta};
|
use crate::{PkgFmt, PkgMeta};
|
||||||
|
@ -53,7 +54,10 @@ impl MultiFetcher {
|
||||||
|
|
||||||
pub async fn first_available(&self) -> Option<&dyn Fetcher> {
|
pub async fn first_available(&self) -> Option<&dyn Fetcher> {
|
||||||
for fetcher in &self.fetchers {
|
for fetcher in &self.fetchers {
|
||||||
if fetcher.check().await.unwrap_or(false) {
|
if fetcher.check().await.unwrap_or_else(|err| {
|
||||||
|
debug!("Error while checking fetcher {}: {}", fetcher.source_name(), err);
|
||||||
|
false
|
||||||
|
}) {
|
||||||
return Some(&**fetcher);
|
return Some(&**fetcher);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue