Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: runtime/bin/socket_patch.dart

Issue 2426413006: Propagate errors correctly in Socket.connect (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_patch.dart
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index 48508274a6ef2ceb1dfe1b62e5e20ecee65211e4..cd02b29ab921253818f8f8f8201660b9a6896a7d 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -449,7 +449,12 @@ class _NativeSocket extends _NativeSocketNativeWrapper with _ServiceObject {
connectNext();
} else {
// Query the local port, for error messages.
- socket.port;
+ try {
+ socket.port;
+ } catch (e) {
+ error = createError(e, "Connection failed", address, port);
+ connectNext();
+ }
// Set up timer for when we should retry the next address
// (if any).
var duration = address.isLoopback ?
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698