Reland "Added mid to error messages reported during SDP apply." This reverts commit 341434e4da2c193b8842917d73afed6eea3a4332. Reason for revert: another attempt to land with Chromium test updated to accept both error messages by CL: https://chromium-review.googlesource.com/c/chromium/src/+/2228545 Original change's description: > Revert "Added mid to error messages reported during SDP apply." > > This reverts commit d2890e8833796f13c4a1243769be966bebdfcaa7. > > Reason for revert: speculative: WebRtcBrowserTest.NegotiateUnsupportedVideoCodec broken on all FYI bots, example: https://ci.chromium.org/p/chromium/builders/webrtc.fyi/WebRTC%20Chromium%20FYI%20Linux%20Tester/6659 > > Original change's description: > > Added mid to error messages reported during SDP apply. > > > > Bug: webrtc:10139 > > Change-Id: I7462b632e00a2da7b189b63022d30f594700b68a > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176400 > > Reviewed-by: Tommi <tommi@webrtc.org> > > Commit-Queue: Yura Yaroshevich <yura.yaroshevich@gmail.com> > > Cr-Commit-Position: refs/heads/master@{#31421} > > TBR=tommi@webrtc.org,yura.yaroshevich@gmail.com > > Change-Id: I18972815df10e2bd7b914ad82df9596009c2fecc > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:10139 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176418 > Reviewed-by: Olga Sharonova <olka@webrtc.org> > Commit-Queue: Olga Sharonova <olka@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#31425} TBR=tommi@webrtc.org,olka@webrtc.org,yura.yaroshevich@gmail.com # Not skipping CQ checks because this is a reland. Bug: webrtc:10139 Change-Id: I603d3891c43ac396bf0ba98c6de189663235c8af Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176448 Reviewed-by: Tommi <tommi@webrtc.org> Commit-Queue: Yura Yaroshevich <yura.yaroshevich@gmail.com> Cr-Commit-Position: refs/heads/master@{#31445}
diff --git a/pc/jsep_transport_controller.cc b/pc/jsep_transport_controller.cc index a7e1b87..c62631d 100644 --- a/pc/jsep_transport_controller.cc +++ b/pc/jsep_transport_controller.cc
@@ -654,7 +654,8 @@ if (IsBundled(content_info.name) && content_info.name != *bundled_mid()) { if (!HandleBundledContent(content_info)) { return RTCError(RTCErrorType::INVALID_PARAMETER, - "Failed to process the bundled m= section."); + "Failed to process the bundled m= section with mid='" + + content_info.name + "'."); } continue; } @@ -706,9 +707,10 @@ } if (!error.ok()) { - LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_PARAMETER, - "Failed to apply the description for " + - content_info.name + ": " + error.message()); + LOG_AND_RETURN_ERROR( + RTCErrorType::INVALID_PARAMETER, + "Failed to apply the description for m= section with mid='" + + content_info.name + "': " + error.message()); } } if (type == SdpType::kAnswer) { @@ -727,11 +729,11 @@ // The BUNDLE group containing a MID that no m= section has is invalid. if (new_bundle_group) { - for (const auto& content_name : new_bundle_group->content_names()) { + for (const std::string& content_name : new_bundle_group->content_names()) { if (!description->GetContentByName(content_name)) { return RTCError(RTCErrorType::INVALID_PARAMETER, - "The BUNDLE group contains MID:" + content_name + - " matching no m= section."); + "The BUNDLE group contains MID='" + content_name + + "' matching no m= section."); } } } @@ -743,18 +745,21 @@ if (new_bundle_group) { // The BUNDLE group in answer should be a subset of offered group. - for (const auto& content_name : new_bundle_group->content_names()) { + for (const std::string& content_name : + new_bundle_group->content_names()) { if (!offered_bundle_group || !offered_bundle_group->HasContentName(content_name)) { return RTCError(RTCErrorType::INVALID_PARAMETER, - "The BUNDLE group in answer contains a MID that was " - "not in the offered group."); + "The BUNDLE group in answer contains a MID='" + + content_name + + "' that was " + "not in the offered group."); } } } if (bundle_group_) { - for (const auto& content_name : bundle_group_->content_names()) { + for (const std::string& content_name : bundle_group_->content_names()) { // An answer that removes m= sections from pre-negotiated BUNDLE group // without rejecting it, is invalid. if (!new_bundle_group || @@ -762,8 +767,9 @@ auto* content_info = description->GetContentByName(content_name); if (!content_info || !content_info->rejected) { return RTCError(RTCErrorType::INVALID_PARAMETER, - "Answer cannot remove m= section " + content_name + - " from already-established BUNDLE group."); + "Answer cannot remove m= section with mid='" + + content_name + + "' from already-established BUNDLE group."); } } } @@ -798,9 +804,9 @@ for (const auto& content_name : bundle_group_->content_names()) { auto other_content = description->GetContentByName(content_name); if (!other_content->rejected) { - return RTCError( - RTCErrorType::INVALID_PARAMETER, - "The m= section:" + content_name + " should be rejected."); + return RTCError(RTCErrorType::INVALID_PARAMETER, + "The m= section with mid='" + content_name + + "' should be rejected."); } } } @@ -815,8 +821,8 @@ content_info.type == cricket::MediaProtocolType::kRtp && !content_info.media_description()->rtcp_mux()) { return RTCError(RTCErrorType::INVALID_PARAMETER, - "The m= section:" + content_info.name + - " is invalid. RTCP-MUX is not " + "The m= section with mid='" + content_info.name + + "' is invalid. RTCP-MUX is not " "enabled when it is required."); } return RTCError::OK();