Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore body_might_complete_normally_catch_error violations #105795

Merged
merged 2 commits into from Jun 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -141,6 +141,9 @@ class TestDefaultBinaryMessenger extends BinaryMessenger {
if (resultFuture != null) {
_pendingMessages.add(resultFuture);
resultFuture
// TODO(srawlins): Fix this static issue,
// https://github.com/flutter/flutter/issues/105750.
// ignore: body_might_complete_normally_catch_error
.catchError((Object error) { /* errors are the responsibility of the caller */ })
.whenComplete(() => _pendingMessages.remove(resultFuture));
}
Expand Down
Expand Up @@ -45,6 +45,9 @@ void main() {
final BinaryMessenger delegate = TestDelegate();
final Future<ByteData?>? future = delegate.send('', null);
expect(future, isNotNull);
// TODO(srawlins): Fix this static issue,
// https://github.com/flutter/flutter/issues/105750.
// ignore: body_might_complete_normally_catch_error
await future!.catchError((Object error) { });
try {
await TestDefaultBinaryMessenger(delegate).send('', null);
Expand Down
12 changes: 10 additions & 2 deletions packages/flutter_tools/lib/src/proxied_devices/devices.dart
Expand Up @@ -520,7 +520,11 @@ class ProxiedPortForwarder extends DevicePortForwarder {
socket.listen((Uint8List data) {
unawaited(connection.sendRequest('proxy.write', <String, Object>{
'id': id,
}, data).catchError((Object error, StackTrace stackTrace) {
}, data)
// TODO(srawlins): Fix this static issue,
// https://github.com/flutter/flutter/issues/105750.
// ignore: body_might_complete_normally_catch_error
.catchError((Object error, StackTrace stackTrace) {
// Log the error, but proceed normally. Network failure should not
// crash the tool. If this is critical, the place where the connection
// is being used would crash.
Expand All @@ -537,7 +541,11 @@ class ProxiedPortForwarder extends DevicePortForwarder {
// Send a proxy disconnect event just in case.
unawaited(connection.sendRequest('proxy.disconnect', <String, Object>{
'id': id,
}).catchError((Object error, StackTrace stackTrace) {
})
// TODO(srawlins): Fix this static issue,
// https://github.com/flutter/flutter/issues/105750.
// ignore: body_might_complete_normally_catch_error
.catchError((Object error, StackTrace stackTrace) {
// Ignore the error here. There might be a race condition when the
// remote end also disconnects. In any case, this request is just to
// notify the remote end to disconnect and we should not crash when
Expand Down
3 changes: 3 additions & 0 deletions packages/flutter_tools/lib/src/vmservice.dart
Expand Up @@ -281,6 +281,9 @@ Future<vm_service.VmService> setUpVmService(
// thrown if we're already subscribed.
registrationRequests.add(vmService
.streamListen(vm_service.EventStreams.kExtension)
// TODO(srawlins): Fix this static issue,
// https://github.com/flutter/flutter/issues/105750.
// ignore: body_might_complete_normally_catch_error
.catchError((Object? error) {}, test: (Object? error) => error is vm_service.RPCError)
);
}
Expand Down
Expand Up @@ -297,7 +297,11 @@ Future<ProcessTestResult> runFlutter(
}
process.stdin.write('q');
return -1; // discarded
}).catchError((Object error) { /* ignore errors here, they will be reported on the next line */ }));
})
// TODO(srawlins): Fix this static issue,
// https://github.com/flutter/flutter/issues/105750.
// ignore: body_might_complete_normally_catch_error
.catchError((Object error) { /* ignore errors here, they will be reported on the next line */ }));
final int exitCode = await process.exitCode;
if (streamingLogs) {
debugPrint('${stamp()} (process terminated with exit code $exitCode)');
Expand Down