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

Unified Diff: pkg/analysis_server/lib/src/server/http_server.dart

Issue 1349263002: Wrap the http server start-up in an exception handler (issue 24363) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/server/http_server.dart
diff --git a/pkg/analysis_server/lib/src/server/http_server.dart b/pkg/analysis_server/lib/src/server/http_server.dart
index 3372933d673364a8be245d04fd254c38a8572775..c047d1fac836065f87b13c3211cd7f05daa99f35 100644
--- a/pkg/analysis_server/lib/src/server/http_server.dart
+++ b/pkg/analysis_server/lib/src/server/http_server.dart
@@ -76,8 +76,13 @@ class HttpAnalysisServer {
* Begin serving HTTP requests over the given port.
*/
void serveHttp(int port) {
- _server = HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, port);
- _server.then(_handleServer);
+ try {
+ _server = HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, port);
+ _server.then(_handleServer);
+ } catch (exception) {
+ // We were unable to start the server, and there's nothing we can do about
+ // it.
+ }
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698