| 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 3c4eed06b798a10dfb643da5531d0ceffe68b2a4..fb44c7ed1842e3bfbb4c03fa7ef326cb2ef573d6 100644
|
| --- a/pkg/analysis_server/lib/src/analysis_server.dart
|
| +++ b/pkg/analysis_server/lib/src/analysis_server.dart
|
| @@ -632,8 +632,14 @@ class AnalysisServer {
|
| if (result != null) {
|
| return result;
|
| }
|
| - nd.AnalysisDriver driver = getAnalysisDriver(path);
|
| - return driver?.getResult(path);
|
| + try {
|
| + nd.AnalysisDriver driver = getAnalysisDriver(path);
|
| + return await driver?.getResult(path);
|
| + } catch (e) {
|
| + // Ignore the exception.
|
| + // We don't want to log the same exception again and again.
|
| + return null;
|
| + }
|
| }
|
|
|
| CompilationUnitElement getCompilationUnitElement(String file) {
|
| @@ -1211,7 +1217,7 @@ class AnalysisServer {
|
| // The result will be produced by the "results" stream with
|
| // the fully resolved unit, and processed with sending analysis
|
| // notifications as it happens after content changes.
|
| - driver.getResult(file);
|
| + driver.getResult(file).catchError((exception, stackTrace) {});
|
| }
|
| }
|
| return;
|
| @@ -1848,6 +1854,10 @@ class ServerContextManagerCallbacks extends ContextManagerCallbacks {
|
| // OCCURRENCES (not used in IDEA)
|
| // OUTLINE (not used in IDEA)
|
| });
|
| + analysisDriver.exceptions.listen((nd.ExceptionResult result) {
|
| + AnalysisEngine.instance.logger
|
| + .logError('Analysis failed: ${result.path}', result.exception);
|
| + });
|
| analysisServer.driverMap[folder] = analysisDriver;
|
| return analysisDriver;
|
| }
|
|
|