Catch exceptions while preparing analysis.implemented notification.

This notification is sent often, and uses index and search engine. We
have several exceptions in internal logs, and all there exceptions are
fatal by default. It seems too harsh to shutdown the server because of
a missing notification.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2376493002 .
This commit is contained in:
Konstantin Shcheglov 2016-09-26 12:54:33 -07:00
parent e9e6b331c3
commit ef015221b1

View file

@ -48,12 +48,19 @@ scheduleImplementedNotification(
for (String file in files) {
CompilationUnitElement unitElement = server.getCompilationUnitElement(file);
if (unitElement != null) {
ImplementedComputer computer =
new ImplementedComputer(searchEngine, unitElement);
await computer.compute();
var params = new protocol.AnalysisImplementedParams(
file, computer.classes, computer.members);
server.sendNotification(params.toNotification());
try {
ImplementedComputer computer =
new ImplementedComputer(searchEngine, unitElement);
await computer.compute();
var params = new protocol.AnalysisImplementedParams(
file, computer.classes, computer.members);
server.sendNotification(params.toNotification());
} catch (exception, stackTrace) {
server.sendServerErrorNotification(
'Failed to send analysis.implemented notification.',
exception,
stackTrace);
}
}
}
}