Revert "[flutter_tool] Where possible, catch only subtypes of Exception (#51440)" (#51539)

This reverts commit f1cd47ef5c.
This commit is contained in:
Zachary Anderson
2020-02-26 23:42:19 -08:00
committed by GitHub
parent f1cd47ef5c
commit 483f49962c
84 changed files with 204 additions and 308 deletions

View File

@@ -211,7 +211,7 @@ class ChromeLauncher {
if (!skipCheck) {
try {
await chrome.chromeConnection.getTabs();
} on Exception catch (e) {
} 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);
} on Exception {
} catch (_) {
// 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.');
}
} on Exception catch (err) {
} catch (err) {
throwToolExit(err.toString());
} finally {
status.stop();