Revert "Reland: [flutter_tool] Where possible, catch only subtypes of Exception (#51567)" (#51616)

This reverts commit 9de7787f25.
This commit is contained in:
Zachary Anderson
2020-02-27 22:57:13 -08:00
committed by GitHub
parent 33bb1faf5b
commit b32ee2f15c
84 changed files with 204 additions and 308 deletions

View File

@@ -139,8 +139,7 @@ Future<void> expectToolExitLater(Future<dynamic> future, Matcher messageMatcher)
fail('ToolExit expected, but nothing thrown');
} on ToolExit catch(e) {
expect(e.message, messageMatcher);
// Catch all exceptions to give a better test failure message.
} catch (e, trace) { // ignore: avoid_catches_without_on_clauses
} catch(e, trace) {
fail('ToolExit expected, got $e\n$trace');
}
}

View File

@@ -151,8 +151,7 @@ void testUsingContext(
return await testMethod();
},
);
// This catch rethrows, so doesn't need to catch only Exception.
} catch (error) { // ignore: avoid_catches_without_on_clauses
} catch (error) {
_printBufferedErrors(context);
rethrow;
}

View File

@@ -398,8 +398,7 @@ class MemoryIOSink implements IOSink {
(List<int> data) {
try {
add(data);
// Catches all exceptions to propagate them to the completer.
} catch (err, stack) { // ignore: avoid_catches_without_on_clauses
} catch (err, stack) {
sub.cancel();
completer.completeError(err, stack);
}