Skip to content

Commit f104be7

Browse files
authored
Ignore body_might_complete_normally_catch_error violations (#105795)
1 parent 32b22b8 commit f104be7

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed

packages/flutter_test/lib/src/test_default_binary_messenger.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ class TestDefaultBinaryMessenger extends BinaryMessenger {
141141
if (resultFuture != null) {
142142
_pendingMessages.add(resultFuture);
143143
resultFuture
144+
// TODO(srawlins): Fix this static issue,
145+
// https://github.com/flutter/flutter/issues/105750.
146+
// ignore: body_might_complete_normally_catch_error
144147
.catchError((Object error) { /* errors are the responsibility of the caller */ })
145148
.whenComplete(() => _pendingMessages.remove(resultFuture));
146149
}

packages/flutter_test/test/test_default_binary_messenger_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ void main() {
4545
final BinaryMessenger delegate = TestDelegate();
4646
final Future<ByteData?>? future = delegate.send('', null);
4747
expect(future, isNotNull);
48+
// TODO(srawlins): Fix this static issue,
49+
// https://github.com/flutter/flutter/issues/105750.
50+
// ignore: body_might_complete_normally_catch_error
4851
await future!.catchError((Object error) { });
4952
try {
5053
await TestDefaultBinaryMessenger(delegate).send('', null);

packages/flutter_tools/lib/src/proxied_devices/devices.dart

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,11 @@ class ProxiedPortForwarder extends DevicePortForwarder {
520520
socket.listen((Uint8List data) {
521521
unawaited(connection.sendRequest('proxy.write', <String, Object>{
522522
'id': id,
523-
}, data).catchError((Object error, StackTrace stackTrace) {
523+
}, data)
524+
// TODO(srawlins): Fix this static issue,
525+
// https://github.com/flutter/flutter/issues/105750.
526+
// ignore: body_might_complete_normally_catch_error
527+
.catchError((Object error, StackTrace stackTrace) {
524528
// Log the error, but proceed normally. Network failure should not
525529
// crash the tool. If this is critical, the place where the connection
526530
// is being used would crash.
@@ -537,7 +541,11 @@ class ProxiedPortForwarder extends DevicePortForwarder {
537541
// Send a proxy disconnect event just in case.
538542
unawaited(connection.sendRequest('proxy.disconnect', <String, Object>{
539543
'id': id,
540-
}).catchError((Object error, StackTrace stackTrace) {
544+
})
545+
// TODO(srawlins): Fix this static issue,
546+
// https://github.com/flutter/flutter/issues/105750.
547+
// ignore: body_might_complete_normally_catch_error
548+
.catchError((Object error, StackTrace stackTrace) {
541549
// Ignore the error here. There might be a race condition when the
542550
// remote end also disconnects. In any case, this request is just to
543551
// notify the remote end to disconnect and we should not crash when

packages/flutter_tools/lib/src/vmservice.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ Future<vm_service.VmService> setUpVmService(
288288
// thrown if we're already subscribed.
289289
registrationRequests.add(vmService
290290
.streamListen(vm_service.EventStreams.kExtension)
291+
// TODO(srawlins): Fix this static issue,
292+
// https://github.com/flutter/flutter/issues/105750.
293+
// ignore: body_might_complete_normally_catch_error
291294
.catchError((Object? error) {}, test: (Object? error) => error is vm_service.RPCError)
292295
);
293296
}

packages/flutter_tools/test/integration.shard/overall_experience_test.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,11 @@ Future<ProcessTestResult> runFlutter(
297297
}
298298
process.stdin.write('q');
299299
return -1; // discarded
300-
}).catchError((Object error) { /* ignore errors here, they will be reported on the next line */ }));
300+
})
301+
// TODO(srawlins): Fix this static issue,
302+
// https://github.com/flutter/flutter/issues/105750.
303+
// ignore: body_might_complete_normally_catch_error
304+
.catchError((Object error) { /* ignore errors here, they will be reported on the next line */ }));
301305
final int exitCode = await process.exitCode;
302306
if (streamingLogs) {
303307
debugPrint('${stamp()} (process terminated with exit code $exitCode)');

0 commit comments

Comments
 (0)