whipsink: Log error body along with status code when POST fails

This commit is contained in:
Arun Raghavan 2022-10-18 16:08:12 +02:00
parent 9180d348bf
commit 03b03fe2dd

View file

@ -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())
]
))
}