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 fd9bfcd24a6c449403a27fe3542f5b7559a53c4d..dff586132d022c5550f61561c6f6ab6d5658b64d 100644 |
--- a/pkg/analysis_server/lib/src/analysis_manager.dart |
+++ b/pkg/analysis_server/lib/src/analysis_manager.dart |
@@ -60,13 +60,16 @@ class AnalysisManager { |
/** |
* Launch an analysis server and open a connection to that server. |
*/ |
- Future<AnalysisManager> _launchServer(String pathToServer) { |
- // TODO dynamically allocate port and/or allow client to specify port |
- List<String> serverArgs = [pathToServer, '--port', PORT.toString()]; |
- return Process.start(Platform.executable, serverArgs).catchError((error) { |
+ Future<AnalysisManager> _launchServer(String pathToServer) async { |
+ try { |
+ // TODO dynamically allocate port and/or allow client to specify port |
+ List<String> serverArgs = [pathToServer, '--port', PORT.toString()]; |
+ Process process = await Process.start(Platform.executable, serverArgs); |
+ return _listenForPort(process); |
+ } catch (error) { |
exitCode = 1; |
throw 'Failed to launch analysis server: $error'; |
- }).then(_listenForPort); |
+ } |
} |
/** |