net/webrtc-http: whipsink: Return a proper error message & not panic
On a server error, we currently crash and panic. Return a proper error
message instead.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/914>
@@ -682,7 +682,10 @@ impl WhipSink {
s if s.is_server_error() => {
// FIXME: Check and handle 'Retry-After' header in case of server error
- todo!()
+ Err(gst::error_msg!(
+ gst::ResourceError::Failed,
+ ["Server returned error: {}", s.as_str()]
+ ))
}
s => Err(gst::error_msg!(
