Reland "ice server parsing: return RTCError with more details"
This is a reland of commit c4b0bde7f2daabc4e0667fb73d096d1cf0819226
which changes the name of the new method and adds a deprecated
backward compatible variant with the old name.
Original change's description:
> ice server parsing: return RTCError with more details
>
> surfacing those errors to the API (without specific details) instead of just the logging.
>
> BUG=webrtc:14539
>
> Change-Id: Id907ebeb08b96b0e4225a016a37a12d58889091b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278340
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#38356}
Bug: webrtc:14539
Change-Id: I0a5482e123f25867582d62101b31ed207b95ea1a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278962
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38364}
diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc
index 02cafc5..4615ce5 100644
--- a/pc/peer_connection.cc
+++ b/pc/peer_connection.cc
@@ -596,10 +596,10 @@
cricket::ServerAddresses stun_servers;
std::vector<cricket::RelayServerConfig> turn_servers;
- RTCErrorType parse_error =
- ParseIceServers(configuration.servers, &stun_servers, &turn_servers);
- if (parse_error != RTCErrorType::NONE) {
- return RTCError(parse_error, "ICE server parse failed");
+ RTCError parse_error = ParseIceServersOrError(configuration.servers,
+ &stun_servers, &turn_servers);
+ if (!parse_error.ok()) {
+ return parse_error;
}
// Add the turn logging id to all turn servers
@@ -1519,10 +1519,10 @@
// Parse ICE servers before hopping to network thread.
cricket::ServerAddresses stun_servers;
std::vector<cricket::RelayServerConfig> turn_servers;
- RTCErrorType parse_error =
- ParseIceServers(configuration.servers, &stun_servers, &turn_servers);
- if (parse_error != RTCErrorType::NONE) {
- return RTCError(parse_error, "ICE server parse failed");
+ RTCError parse_error = ParseIceServersOrError(configuration.servers,
+ &stun_servers, &turn_servers);
+ if (!parse_error.ok()) {
+ return parse_error;
}
// Add the turn logging id to all turn servers
for (cricket::RelayServerConfig& turn_server : turn_servers) {