mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:39:49 +00:00
Propagate errors correctly in Socket.connect
socket.port can throw an exception. The error from the exception, if there is one, has to go to the completer, not be thrown up the stack, otherwise it may go to the enclosing Zone rather than e.g. a try ... catch around await Socket.connetc(). This is a possible fix for the issue below, but it is tough to say because I don't have a reliable repro. related #27440 R=asiva@google.com Review URL: https://codereview.chromium.org/2426413006 .
This commit is contained in:
parent
9d29251368
commit
16db33b7a2
|
@ -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 ?
|
||||
|
|
Loading…
Reference in a new issue