Catch more errors

This commit is contained in:
Radon Rosborough 2021-08-26 18:46:04 -07:00
parent d3ab5d6336
commit c9af422461
1 changed files with 66 additions and 54 deletions

View File

@ -417,14 +417,19 @@ export class Session {
};
stopLSP = async () => {
try {
if (this.lsp) {
this.lsp.stopping = true;
this.lsp.proc.kill();
this.lsp = null;
}
} catch (err) {
logError(err);
}
};
startLSP = async () => {
try {
if (this.config.lsp) {
await this.stopLSP();
if (this.config.lsp.setup) {
@ -471,15 +476,22 @@ export class Session {
);
this.send({ event: "lspStarted", root: this.homedir });
}
} catch (err) {
logError(err);
}
};
ensure = async (cmd) => {
try {
const code = (
await this.run(this.privilegedExec(cmd), {
check: false,
})
).code;
this.send({ event: "ensured", code });
} catch (err) {
logError(err);
}
};
teardown = async () => {