Chromium Code Reviews| 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 b1941df1695362aea68544f70e4340feec19b504..318d3d22890e49e4d7d2e586753ffafa61861480 100644 |
| --- a/pkg/analysis_server/lib/src/analysis_server.dart |
| +++ b/pkg/analysis_server/lib/src/analysis_server.dart |
| @@ -512,7 +512,7 @@ class AnalysisServer { |
| } |
| } |
| channel.sendResponse(new Response.unknownRequest(request)); |
| - }, onError: _sendServerErrorNotification); |
| + }, onError: sendServerErrorNotification); |
| } |
| /** |
| @@ -603,7 +603,7 @@ class AnalysisServer { |
| 'Unexpected exception during analysis', |
| new CaughtException(exception, stackTrace)); |
| } |
| - _sendServerErrorNotification(exception, stackTrace); |
| + sendServerErrorNotification(exception, stackTrace); |
| shutdown(); |
| } finally { |
| if (!operationQueue.isEmpty) { |
| @@ -627,14 +627,6 @@ class AnalysisServer { |
| } |
| /** |
| - * Report to the client that the given [exception] was caught with the |
| - * associated [stackTrace]. |
| - */ |
| - void reportException(dynamic exception, StackTrace stackTrace) { |
| - _sendServerErrorNotification(exception, stackTrace); |
| - } |
| - |
| - /** |
| * Schedules execution of the given [ServerOperation]. |
| */ |
| void scheduleOperation(ServerOperation operation) { |
| @@ -680,6 +672,32 @@ class AnalysisServer { |
| } |
| /** |
| + * Sends a `server.error` notification. |
| + */ |
| + void sendServerErrorNotification(exception, stackTrace, {bool fatal: true}) { |
|
Brian Wilkerson
2015/01/13 20:57:37
It looks like "false" is more common than "true".
scheglov
2015/01/13 21:13:51
Done.
|
| + // prepare exception.toString() |
| + String exceptionString; |
| + if (exception != null) { |
| + exceptionString = exception.toString(); |
| + } else { |
| + exceptionString = 'null exception'; |
| + } |
| + // prepare stackTrace.toString() |
| + String stackTraceString; |
| + if (stackTrace != null) { |
| + stackTraceString = stackTrace.toString(); |
| + } else { |
| + stackTraceString = 'null stackTrace'; |
| + } |
| + // send the notification |
| + channel.sendNotification( |
| + new ServerErrorParams( |
| + fatal, |
| + exceptionString, |
| + stackTraceString).toNotification()); |
| + } |
| + |
| + /** |
| * Send status notification to the client. The `operation` is the operation |
| * being performed or `null` if analysis is complete. |
| */ |
| @@ -915,32 +933,6 @@ class AnalysisServer { |
| new Future(performOperation); |
| performOperationPending = true; |
| } |
| - |
| - /** |
| - * Sends a fatal `server.error` notification. |
| - */ |
| - void _sendServerErrorNotification(exception, stackTrace) { |
| - // prepare exception.toString() |
| - String exceptionString; |
| - if (exception != null) { |
| - exceptionString = exception.toString(); |
| - } else { |
| - exceptionString = 'null exception'; |
| - } |
| - // prepare stackTrace.toString() |
| - String stackTraceString; |
| - if (stackTrace != null) { |
| - stackTraceString = stackTrace.toString(); |
| - } else { |
| - stackTraceString = 'null stackTrace'; |
| - } |
| - // send the notification |
| - channel.sendNotification( |
| - new ServerErrorParams( |
| - true, |
| - exceptionString, |
| - stackTraceString).toNotification()); |
| - } |
| } |