mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-17 10:53:37 +00:00
Better offline error message (#2110)
Error for `uv pip compile scripts/requirements/jupyter.in` without internet: **Before** ``` error: error sending request for url (https://pypi.org/simple/jupyter/): error trying to connect: dns error: failed to lookup address information: No such host is known. (os error 11001) Caused by: error trying to connect: dns error: failed to lookup address information: No such host is known. (os error 11001) Caused by: dns error: failed to lookup address information: No such host is known. (os error 11001) Caused by: failed to lookup address information: No such host is known. (os error 11001) ``` **After** ``` error: Could not connect, are you offline? Caused by: error sending request for url (https://pypi.org/simple/django/): error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution Caused by: error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution Caused by: dns error: failed to lookup address information: Temporary failure in name resolution Caused by: failed to lookup address information: Temporary failure in name resolution ``` On linux, it would be "Temporary failure in name resolution" instead of "No such host is known. (os error 11001)". The implementation checks for "dne error" stringly as hyper errors are opaque. The danger is that this breaks with a hyper update. We still get the complete error trace since reqwest eagerly inlines errors (https://github.com/seanmonstar/reqwest/issues/2147). No test since i wouldn't know how to simulate this in cargo test. Fixes #1971
This commit is contained in:
parent
bc0345a1fd
commit
898c3f6bcf
7 changed files with 106 additions and 36 deletions
|
|
@ -1,5 +1,5 @@
|
|||
pub use cached_client::{CacheControl, CachedClient, CachedClientError, DataWithCachePolicy};
|
||||
pub use error::{Error, ErrorKind};
|
||||
pub use error::{BetterReqwestError, Error, ErrorKind};
|
||||
pub use flat_index::{FlatDistributions, FlatIndex, FlatIndexClient, FlatIndexError};
|
||||
pub use registry_client::{
|
||||
Connectivity, RegistryClient, RegistryClientBuilder, SimpleMetadata, SimpleMetadatum,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue