Change PeerConnection error codes

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 <benwright@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22924}
This commit is contained in:
Harald Alvestrand
2018-04-13 15:02:10 +02:00
committed by Commit Bot
parent 104ad0b62b
commit 3725d544fa

View File

@ -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;
}