diff options
author | Arun Raghavan <arun@asymptotic.io> | 2022-10-18 17:08:12 +0300 |
---|---|---|
committer | Arun Raghavan <arun@asymptotic.io> | 2022-10-18 18:01:36 +0300 |
commit | 03b03fe2ddc792f7860764bfbfb35a5129cba07a (patch) | |
tree | 5959eaf32ee825726668d7e92c958b3c9c2375ad /net | |
parent | 9180d348bf60fcc62f86c6600d5e1e5ee35cb159 (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.rs | 8 |
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()) + ] )) } |