mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-15 07:06:36 +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;
|
||||
|
||||
pub use gh_crate_meta::*;
|
||||
pub use log::debug;
|
||||
pub use quickinstall::*;
|
||||
|
||||
use crate::{PkgFmt, PkgMeta};
|
||||
|
@ -53,7 +54,10 @@ impl MultiFetcher {
|
|||
|
||||
pub async fn first_available(&self) -> Option<&dyn Fetcher> {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue