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

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

Issue 1842063003: Start making server strong mode clean (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Remove unintended change 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
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);
+ }
}
/**

Powered by Google App Engine
This is Rietveld 408576698