forked from firka/flutter
Reland: [flutter_tool] Where possible, catch only subtypes of Exception (#52021)
* Reland: [flutter_tool] Where possible, catch only subtypes of Exception * Add armv7f to getIOSArchForName
This commit is contained in:
@@ -139,7 +139,8 @@ Future<void> expectToolExitLater(Future<dynamic> future, Matcher messageMatcher)
|
||||
fail('ToolExit expected, but nothing thrown');
|
||||
} on ToolExit catch(e) {
|
||||
expect(e.message, messageMatcher);
|
||||
} catch(e, trace) {
|
||||
// Catch all exceptions to give a better test failure message.
|
||||
} catch (e, trace) { // ignore: avoid_catches_without_on_clauses
|
||||
fail('ToolExit expected, got $e\n$trace');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,8 @@ void testUsingContext(
|
||||
return await testMethod();
|
||||
},
|
||||
);
|
||||
} catch (error) {
|
||||
// This catch rethrows, so doesn't need to catch only Exception.
|
||||
} catch (error) { // ignore: avoid_catches_without_on_clauses
|
||||
_printBufferedErrors(context);
|
||||
rethrow;
|
||||
}
|
||||
|
||||
@@ -398,7 +398,8 @@ class MemoryIOSink implements IOSink {
|
||||
(List<int> data) {
|
||||
try {
|
||||
add(data);
|
||||
} catch (err, stack) {
|
||||
// Catches all exceptions to propagate them to the completer.
|
||||
} catch (err, stack) { // ignore: avoid_catches_without_on_clauses
|
||||
sub.cancel();
|
||||
completer.completeError(err, stack);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user