| Index: pkg/analysis_server/lib/src/analysis_server.dart
|
| diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
|
| index d5944ba01154dbca78735eed012ebebd317f3400..c4ca2d2330a7d256fb6cd7d4dea42da5dee2875b 100644
|
| --- a/pkg/analysis_server/lib/src/analysis_server.dart
|
| +++ b/pkg/analysis_server/lib/src/analysis_server.dart
|
| @@ -389,23 +389,32 @@ class AnalysisServer {
|
| * Handle a [request] that was read from the communication channel.
|
| */
|
| void handleRequest(Request request) {
|
| - int count = handlers.length;
|
| - for (int i = 0; i < count; i++) {
|
| - try {
|
| - Response response = handlers[i].handleRequest(request);
|
| - if (response == Response.DELAYED_RESPONSE) {
|
| + runZoned(() {
|
| + int count = handlers.length;
|
| + for (int i = 0; i < count; i++) {
|
| + try {
|
| + Response response = handlers[i].handleRequest(request);
|
| + if (response == Response.DELAYED_RESPONSE) {
|
| + return;
|
| + }
|
| + if (response != null) {
|
| + channel.sendResponse(response);
|
| + return;
|
| + }
|
| + } on RequestFailure catch (exception) {
|
| + channel.sendResponse(exception.response);
|
| return;
|
| - }
|
| - if (response != null) {
|
| + } catch (exception, stackTrace) {
|
| + _sendServerErrorNotification(exception, stackTrace);
|
| + RequestError error =
|
| + new RequestError(RequestErrorCode.SERVER_ERROR, 'Server Error');
|
| + Response response = new Response(request.id, error: error);
|
| channel.sendResponse(response);
|
| return;
|
| }
|
| - } on RequestFailure catch (exception) {
|
| - channel.sendResponse(exception.response);
|
| - return;
|
| }
|
| - }
|
| - channel.sendResponse(new Response.unknownRequest(request));
|
| + channel.sendResponse(new Response.unknownRequest(request));
|
| + }, onError: _sendServerErrorNotification);
|
| }
|
|
|
| /**
|
|
|