wrap plugin indexer in try/catch block (#3812)
diff --git a/kythe/typescript/indexer.ts b/kythe/typescript/indexer.ts
index b76857c..50fd4ac 100644
--- a/kythe/typescript/indexer.ts
+++ b/kythe/typescript/indexer.ts
@@ -1216,9 +1216,13 @@
if (plugins) {
for (const plugin of plugins) {
- plugin.index(
- (path: string) => getFileVName(path, pathVNames, vname), paths,
- program, emit);
+ try {
+ plugin.index(
+ (path: string) => getFileVName(path, pathVNames, vname), paths,
+ program, emit);
+ } catch (err) {
+ console.error(`Plugin ${plugin.name} errored: ${err}`);
+ }
}
}
}