Open konstin opened 4 months ago
@cbeck88 @konstin is there anything preventing this PR from being merged? I'm using uv as a dependency in a project and had to patch reqwest-middleware
in my Cargo.toml
, and I know there are other projects that are refraining from update to the latest uv libraries to avoid this issue (e.g. pixi).
Let me know if I can help in any way here ;)
@cbeck88 @konstin is there anything preventing this PR from being merged? I'm using uv as a dependency in a project and had to patch
reqwest-middleware
in myCargo.toml
, and I know there are other projects that are refraining from update to the latest uv libraries to avoid this issue (e.g. pixi).Let me know if I can help in any way here ;)
At a minimum, the cargo toml has to be fixed, because 0.6.0 was already released
We haven't yet heard from maintainers whether they want to go in this direction. Currently the number of retries is reported by logging and the log level is configurable.
If they do, imo more thought should be given to exactly what the structure of the error is, because existing code that needs to access the underlying reqwest error will have to downcast, and any changes to that structure in the future will be breaking changes. Maybe better to have private fields and pub fn
getters.
If they don't want the patch, there's probably still a path forward for uv
to get the number of retries without forking this crate, for example by injecting a custom strategy object that wraps the default one and contains a counter, or adding another middleware layer I guess.
As a user or developer, it is hard to tell whether a request failed randomly and was not retried, or whether it failed even with retries (e.g. https://github.com/astral-sh/uv/issues/3514). This PR adds the number of retries to the error chain if there were any retries. Example error chain:
I've also changed
request_middleware::Error
transparent to avoid being to verbose.