util: wrap tree-kill in try-catch
This change won't actually fix the issue, but it will at least catch the TypeError.
Updates golang/vscode-go#90
Change-Id: I07c47bc1fc91ce674ee21cea8f0f4918a8328366
GitHub-Last-Rev: af1b7dc135a1c5227bba5a22a76ea1d322ad2398
GitHub-Pull-Request: golang/vscode-go#99
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/235359
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
diff --git a/src/util.ts b/src/util.ts
index 19e87a0..6b96a0b 100644
--- a/src/util.ts
+++ b/src/util.ts
@@ -852,11 +852,15 @@
}
export const killTree = (processId: number): void => {
- kill(processId, (err) => {
- if (err) {
- console.log('Error killing process tree: ' + err);
- }
- });
+ try {
+ kill(processId, (err) => {
+ if (err) {
+ console.log(`Error killing process tree: ${err}`);
+ }
+ });
+ } catch (err) {
+ console.log(`Error killing process tree: ${err}`);
+ }
};
export function killProcess(p: cp.ChildProcess) {