Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sdroege/gst-plugin-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorArun Raghavan <arun@asymptotic.io>2022-10-18 17:08:12 +0300
committerArun Raghavan <arun@asymptotic.io>2022-10-18 18:01:36 +0300
commit03b03fe2ddc792f7860764bfbfb35a5129cba07a (patch)
tree5959eaf32ee825726668d7e92c958b3c9c2375ad /net
parent9180d348bf60fcc62f86c6600d5e1e5ee35cb159 (diff)
whipsink: Log error body along with status code when POST fails
Diffstat (limited to 'net')
-rw-r--r--net/webrtc-http/src/whipsink/imp.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/webrtc-http/src/whipsink/imp.rs b/net/webrtc-http/src/whipsink/imp.rs
index fe5e40f1..4aa75dbe 100644
--- a/net/webrtc-http/src/whipsink/imp.rs
+++ b/net/webrtc-http/src/whipsink/imp.rs
@@ -684,7 +684,13 @@ impl WhipSink {
// FIXME: Check and handle 'Retry-After' header in case of server error
Err(gst::error_msg!(
gst::ResourceError::Failed,
- ["Server returned error: {}", s.as_str()]
+ [
+ "Server returned error: {} - {}",
+ s.as_str(),
+ self.wait(resp.bytes())
+ .map(|x| x.escape_ascii().to_string())
+ .unwrap_or_else(|_| "(no further details)".to_string())
+ ]
))
}