Skip to content

web_socket_channel 2.3.0 - IOWebSocketChannel.connect Doesn't Handle SocketException #1519

@knnkrt

Description

@knnkrt

When I close the internet connection to test what happens in onDone method,

Trying to handle exception but it doesn't handle;

try {
  _channel = IOWebSocketChannel.connect(
   Uri.parse("wss://MY_URL.com/ws/"),
  );
} on SocketException {
  print("HANDLE");
}

This code works on web_socket_channel version 2.2.0 (even I don't need to use) but on version 2.3.0 I'm getting:

SocketException (SocketException: Failed host lookup: 'MY_URL.com' (OS Error: No address associated with hostname, errno = 7))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions