Let ValidateSessionDescription decide error on failure

Return the error code from ValidateSessionDescription rather than
returning INTERNAL_ERROR for every failure case.

Bug: chromium:1490510
Change-Id: I3b745174ce986f9d7ebfa051c116b1c9d29e31c2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/322622
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40885}
This commit is contained in:
Harald Alvestrand 2023-10-06 11:32:41 +00:00 committed by WebRTC LUCI CQ
parent a4b2b95f99
commit 85ea965cc5

View File

@ -2364,7 +2364,7 @@ void SdpOfferAnswerHandler::DoSetLocalDescription(
cricket::CS_LOCAL, desc->GetType(), error);
RTC_LOG(LS_ERROR) << error_message;
observer->OnSetLocalDescriptionComplete(
RTCError(RTCErrorType::INTERNAL_ERROR, std::move(error_message)));
RTCError(error.type(), std::move(error_message)));
return;
}