mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Catch ipc errors on proxy exit (#214)
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
parent
70abf73176
commit
b95e45b75b
@ -59,7 +59,7 @@ export class KubeAuthProxy {
|
||||
})
|
||||
this.proxyProcess.on("exit", (code) => {
|
||||
logger.error(`proxy ${this.cluster.contextName} exited with code ${code}`)
|
||||
this.sendIpcLogMessage( `proxy exited with code ${code}`, "stderr")
|
||||
this.sendIpcLogMessage( `proxy exited with code ${code}`, "stderr").catch((_) => {})
|
||||
this.proxyProcess = null
|
||||
configWatcher.close()
|
||||
})
|
||||
@ -95,15 +95,14 @@ export class KubeAuthProxy {
|
||||
return errorMsg
|
||||
}
|
||||
|
||||
protected sendIpcLogMessage(data: string, stream: string) {
|
||||
this.promiseIpc.send(`kube-auth:${this.cluster.id}`, findMainWebContents(), { data: data, stream: stream })
|
||||
protected async sendIpcLogMessage(data: string, stream: string) {
|
||||
await this.promiseIpc.send(`kube-auth:${this.cluster.id}`, findMainWebContents(), { data: data, stream: stream })
|
||||
}
|
||||
|
||||
public exit() {
|
||||
if (this.proxyProcess) {
|
||||
logger.debug(`Stopping local proxy: ${this.cluster.contextName}`)
|
||||
this.proxyProcess.kill()
|
||||
this.proxyProcess = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user