mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-09-24 21:10:05 +00:00
reqwesthttpsrc: Correctly forward Future errors instead of mapping them all to timeouts
This commit is contained in:
parent
120f85ac71
commit
99836709fa
1 changed files with 10 additions and 2 deletions
|
@ -481,7 +481,7 @@ impl ReqwestHttpSrc {
|
||||||
let uri_clone = uri.clone();
|
let uri_clone = uri.clone();
|
||||||
let res = self.wait(req.send().map_err(move |err| {
|
let res = self.wait(req.send().map_err(move |err| {
|
||||||
gst_error_msg!(
|
gst_error_msg!(
|
||||||
gst::ResourceError::Read,
|
gst::ResourceError::OpenRead,
|
||||||
["Failed to fetch {}: {:?}", uri_clone, err]
|
["Failed to fetch {}: {:?}", uri_clone, err]
|
||||||
)
|
)
|
||||||
}));
|
}));
|
||||||
|
@ -633,7 +633,15 @@ impl ReqwestHttpSrc {
|
||||||
Either::B(
|
Either::B(
|
||||||
future
|
future
|
||||||
.timeout(Duration::from_secs(timeout.into()))
|
.timeout(Duration::from_secs(timeout.into()))
|
||||||
.map_err(|_err| gst_error_msg!(gst::ResourceError::Read, ["Request timeout"])),
|
.map_err(|err| {
|
||||||
|
if err.is_elapsed() {
|
||||||
|
gst_error_msg!(gst::ResourceError::Read, ["Request timeout"])
|
||||||
|
} else if err.is_inner() {
|
||||||
|
err.into_inner().unwrap()
|
||||||
|
} else {
|
||||||
|
gst_error_msg!(gst::ResourceError::Read, ["Timer error: {}", err])
|
||||||
|
}
|
||||||
|
}),
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue