SIGN IN SIGN UP

[flutter_tools] Handle HttpException during VM service connection (#191182)

This PR handles `io.HttpException` thrown during the VM service
connection process in `flutter_tools`.

### Problem
When connecting to the VM service, if the server closes the HTTP
connection prematurely (e.g., "Connection closed before full header was
received"), `io.WebSocket.connect` throws an `io.HttpException`. This
exception was not caught in `_defaultOpenChannel` in `vmservice.dart`,
causing the connection loop to terminate abruptly with an unhandled
exception and crashing the tool.

### Fix
- Added `io.HttpException` to the caught exceptions in
`_defaultOpenChannel` (`vmservice.dart`), ensuring connection attempts
retry with exponential backoff rather than crashing.
- Added unit test in `vmservice_test.dart` verifying retry messages and
logging behavior when `io.HttpException` is encountered during
connection.

Fixes https://github.com/flutter/flutter/issues/191178
B
Ben Konyi committed
2f0274cacb97abd18002f608d726531c804670c9
Parent: 3b026a2
Committed by GitHub <noreply@github.com> on 8/19/2026, 11:01:25 AM