Catch more errors
This commit is contained in:
parent
d3ab5d6336
commit
c9af422461
|
@ -417,14 +417,19 @@ export class Session {
|
||||||
};
|
};
|
||||||
|
|
||||||
stopLSP = async () => {
|
stopLSP = async () => {
|
||||||
|
try {
|
||||||
if (this.lsp) {
|
if (this.lsp) {
|
||||||
this.lsp.stopping = true;
|
this.lsp.stopping = true;
|
||||||
this.lsp.proc.kill();
|
this.lsp.proc.kill();
|
||||||
this.lsp = null;
|
this.lsp = null;
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
logError(err);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
startLSP = async () => {
|
startLSP = async () => {
|
||||||
|
try {
|
||||||
if (this.config.lsp) {
|
if (this.config.lsp) {
|
||||||
await this.stopLSP();
|
await this.stopLSP();
|
||||||
if (this.config.lsp.setup) {
|
if (this.config.lsp.setup) {
|
||||||
|
@ -471,15 +476,22 @@ export class Session {
|
||||||
);
|
);
|
||||||
this.send({ event: "lspStarted", root: this.homedir });
|
this.send({ event: "lspStarted", root: this.homedir });
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
logError(err);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ensure = async (cmd) => {
|
ensure = async (cmd) => {
|
||||||
|
try {
|
||||||
const code = (
|
const code = (
|
||||||
await this.run(this.privilegedExec(cmd), {
|
await this.run(this.privilegedExec(cmd), {
|
||||||
check: false,
|
check: false,
|
||||||
})
|
})
|
||||||
).code;
|
).code;
|
||||||
this.send({ event: "ensured", code });
|
this.send({ event: "ensured", code });
|
||||||
|
} catch (err) {
|
||||||
|
logError(err);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
teardown = async () => {
|
teardown = async () => {
|
||||||
|
|
Loading…
Reference in New Issue