File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -138,10 +138,11 @@ class DevHandler {
138138 for (final injectedConnection in _injectedConnections) {
139139 try {
140140 injectedConnection.sink.add (jsonEncode (serializers.serialize (request)));
141- } on StateError catch (_) {
142- // The sink has already closed (app is disconnected), swallow the
143- // error.
144- _logger.warning ('Failed to send request to client, connection closed.' );
141+ } on StateError catch (e) {
142+ // The sink has already closed (app is disconnected), or another StateError occurred.
143+ _logger.warning (
144+ 'Failed to send request to client, connection likely closed. Error: $e ' ,
145+ );
145146 } catch (e, s) {
146147 // Catch any other potential errors during sending.
147148 _logger.severe ('Error sending request to client: $e ' , e, s);
You can’t perform that action at this time.
0 commit comments