From 3725d544fad8b676246d8aaeb18fbd50b46f1b06 Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Fri, 13 Apr 2018 15:02:10 +0200 Subject: [PATCH] Change PeerConnection error codes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change error code for "state mismatch" to "State error", and also change some parameter errors to "Illegal parameter". Bug: chromium:819629 Change-Id: I9347d4161344b4ff2bcb58ad82fa6d533cd476fb Reviewed-on: https://webrtc-review.googlesource.com/69815 Reviewed-by: Benjamin Wright Reviewed-by: Henrik Boström Commit-Queue: Harald Alvestrand Cr-Commit-Position: refs/heads/master@{#22924} --- pc/peerconnection.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pc/peerconnection.cc b/pc/peerconnection.cc index c352960383..3966e2341e 100644 --- a/pc/peerconnection.cc +++ b/pc/peerconnection.cc @@ -1745,7 +1745,7 @@ void PeerConnection::CreateOffer(CreateSessionDescriptionObserver* observer, std::string error = "CreateOffer called when PeerConnection is closed."; RTC_LOG(LS_ERROR) << error; PostCreateSessionDescriptionFailure( - observer, RTCError(RTCErrorType::INTERNAL_ERROR, std::move(error))); + observer, RTCError(RTCErrorType::INVALID_STATE, std::move(error))); return; } @@ -1753,7 +1753,7 @@ void PeerConnection::CreateOffer(CreateSessionDescriptionObserver* observer, std::string error = "CreateOffer called with invalid options."; RTC_LOG(LS_ERROR) << error; PostCreateSessionDescriptionFailure( - observer, RTCError(RTCErrorType::INTERNAL_ERROR, std::move(error))); + observer, RTCError(RTCErrorType::INVALID_PARAMETER, std::move(error))); return; } @@ -1860,7 +1860,7 @@ void PeerConnection::CreateAnswer( std::string error = "CreateAnswer called with invalid constraints."; RTC_LOG(LS_ERROR) << error; PostCreateSessionDescriptionFailure( - observer, RTCError(RTCErrorType::INTERNAL_ERROR, std::move(error))); + observer, RTCError(RTCErrorType::INVALID_PARAMETER, std::move(error))); return; } @@ -1882,7 +1882,7 @@ void PeerConnection::CreateAnswer(CreateSessionDescriptionObserver* observer, "have-remote-offer or have-local-pranswer."; RTC_LOG(LS_ERROR) << error; PostCreateSessionDescriptionFailure( - observer, RTCError(RTCErrorType::INTERNAL_ERROR, std::move(error))); + observer, RTCError(RTCErrorType::INVALID_STATE, std::move(error))); return; }