Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: pkg/analysis_server/lib/src/analysis_manager.dart

Issue 1855643002: More strong mode changes to analysis_server (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Backout changes to options file Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/lib/plugin/protocol/protocol.dart ('k') | pkg/analysis_server/lib/src/collections.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/analysis_manager.dart
diff --git a/pkg/analysis_server/lib/src/analysis_manager.dart b/pkg/analysis_server/lib/src/analysis_manager.dart
index dff586132d022c5550f61561c6f6ab6d5658b64d..2e9924cb37ff96504583f969a313b862b0ab274c 100644
--- a/pkg/analysis_server/lib/src/analysis_manager.dart
+++ b/pkg/analysis_server/lib/src/analysis_manager.dart
@@ -75,7 +75,7 @@ class AnalysisManager {
/**
* Listen for a port from the given analysis server process.
*/
- Future<AnalysisManager> _listenForPort(Process process) {
+ Future<AnalysisManager> _listenForPort(Process process) async {
this.process = process;
// Echo stdout and stderr
@@ -85,18 +85,18 @@ class AnalysisManager {
// Listen for port from server
const String pattern = 'Listening on port ';
- return out
- .firstWhere((String line) => line.startsWith(pattern))
- .timeout(new Duration(seconds: 10))
- .catchError((error) {
- exitCode = 1;
- process.kill();
- throw 'Expected port from analysis server';
- }).then((String line) {
+ try {
+ String line = await out
+ .firstWhere((String line) => line.startsWith(pattern))
+ .timeout(new Duration(seconds: 10));
String port = line.substring(pattern.length).trim();
String url = 'ws://${InternetAddress.LOOPBACK_IP_V4.address}:$port/';
return _openConnection(url);
- });
+ } catch (error) {
+ exitCode = 1;
+ process.kill();
+ throw 'Expected port from analysis server';
+ }
}
/**
« no previous file with comments | « pkg/analysis_server/lib/plugin/protocol/protocol.dart ('k') | pkg/analysis_server/lib/src/collections.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698