-
In ureq 2.0, HTTP errors included the URL in their output, e.g.,
In 3.0 the URL is no longer displayed. The output is instead:
Is there a configuration I can set to restore URLs to the error messages? TIA. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There isn't any such option, and introducing one would be a semver breaking change. It's a post-rationalization since it was a rather late insight in the 3.x development, but URLs can contain sensitive data, so on balance it might good to not leak them unnecessarily. In your case I'd suggest you turn this error off using http_status_as_error(false) The logic ureq uses for triggering the error is very simple: |
Beta Was this translation helpful? Give feedback.
There isn't any such option, and introducing one would be a semver breaking change.
It's a post-rationalization since it was a rather late insight in the 3.x development, but URLs can contain sensitive data, so on balance it might good to not leak them unnecessarily.
In your case I'd suggest you turn this error off using http_status_as_error(false)
. And then check the error code manually on the
Response
.The logic ureq uses for triggering the error is very simple:
https://github.com/algesten/ureq/blob/main/src/run.rs#L102-L103