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:
Zachary Anderson
2020-03-06 10:22:12 -08:00
committed by GitHub
parent 2294d75bfa
commit 6c408a0567
83 changed files with 307 additions and 203 deletions

View File

@@ -211,7 +211,7 @@ class ChromeLauncher {
if (!skipCheck) {
try {
await chrome.chromeConnection.getTabs();
} catch (e) {
} on Exception catch (e) {
await chrome.close();
throwToolExit(
'Unable to connect to Chrome debug port: ${chrome.debugPort}\n $e');
@@ -235,7 +235,7 @@ class ChromeLauncher {
final HttpClientResponse response = await request.close();
final List<dynamic> jsonObject = await json.fuse(utf8).decoder.bind(response).single as List<dynamic>;
return base.resolve(jsonObject.first['devtoolsFrontendUrl'] as String);
} catch (_) {
} on Exception {
// If we fail to talk to the remote debugger protocol, give up and return
// the raw URL rather than crashing.
return base;

View File

@@ -66,7 +66,7 @@ Future<void> buildWeb(
}
throwToolExit('Failed to compile application for the Web.');
}
} catch (err) {
} on Exception catch (err) {
throwToolExit(err.toString());
} finally {
status.stop();