Catch more errors
This commit is contained in:
parent
d3ab5d6336
commit
c9af422461
|
@ -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 () => {
|
||||
|
|
Loading…
Reference in New Issue