make ice server parsing error and logging more consistent
BUG=None
Change-Id: I1b88d01f8e592b11df31030ee70e6a39a4155773
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237220
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#35307}
diff --git a/pc/ice_server_parsing.cc b/pc/ice_server_parsing.cc
index d9b4c39..b7395c8 100644
--- a/pc/ice_server_parsing.cc
+++ b/pc/ice_server_parsing.cc
@@ -237,7 +237,7 @@
if (server.username.empty() || server.password.empty()) {
// The WebRTC spec requires throwing an InvalidAccessError when username
// or credential are ommitted; this is the native equivalent.
- RTC_LOG(LS_ERROR) << "TURN server with empty username or password";
+ RTC_LOG(LS_WARNING) << "TURN server with empty username or password";
return RTCErrorType::INVALID_PARAMETER;
}
// If the hostname field is not empty, then the server address must be
@@ -251,7 +251,7 @@
if (!IPFromString(address, &ip)) {
// When hostname is set, the server address must be a
// resolved ip address.
- RTC_LOG(LS_ERROR)
+ RTC_LOG(LS_WARNING)
<< "IceServer has hostname field set, but URI does not "
"contain an IP address.";
return RTCErrorType::INVALID_PARAMETER;
@@ -289,7 +289,7 @@
if (!server.urls.empty()) {
for (const std::string& url : server.urls) {
if (url.empty()) {
- RTC_LOG(LS_ERROR) << "Empty uri.";
+ RTC_LOG(LS_WARNING) << "Empty uri.";
return RTCErrorType::SYNTAX_ERROR;
}
RTCErrorType err =
@@ -306,7 +306,7 @@
return err;
}
} else {
- RTC_LOG(LS_ERROR) << "Empty uri.";
+ RTC_LOG(LS_WARNING) << "Empty uri.";
return RTCErrorType::SYNTAX_ERROR;
}
}
diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc
index 9843eeb..de13d4c 100644
--- a/pc/peer_connection.cc
+++ b/pc/peer_connection.cc
@@ -1458,7 +1458,7 @@
RTCErrorType parse_error =
ParseIceServers(configuration.servers, &stun_servers, &turn_servers);
if (parse_error != RTCErrorType::NONE) {
- return RTCError(parse_error);
+ return RTCError(parse_error, "ICE server parse failed");
}
// Add the turn logging id to all turn servers
for (cricket::RelayServerConfig& turn_server : turn_servers) {