mirror of
https://github.com/desktop/desktop
synced 2024-09-18 07:32:01 +00:00
Track trampoline server/client errors separately
We don't need to close the server when the error comes from the client.
This commit is contained in:
parent
5162e0c641
commit
3f4da2c8b9
|
@ -66,7 +66,7 @@ export class TrampolineServer {
|
|||
this.server.listen(0, '127.0.0.1', async () => {
|
||||
// Replace the error handler
|
||||
this.server.removeAllListeners('error')
|
||||
this.server.on('error', this.onError)
|
||||
this.server.on('error', this.onServerError)
|
||||
|
||||
resolve()
|
||||
})
|
||||
|
@ -126,7 +126,7 @@ export class TrampolineServer {
|
|||
this.onDataReceived(socket, parser, data)
|
||||
})
|
||||
|
||||
socket.on('error', this.onError)
|
||||
socket.on('error', this.onClientError)
|
||||
}
|
||||
|
||||
private onDataReceived(
|
||||
|
@ -179,10 +179,14 @@ export class TrampolineServer {
|
|||
}
|
||||
}
|
||||
|
||||
private onError = (error: Error) => {
|
||||
private onServerError = (error: Error) => {
|
||||
sendNonFatalException('trampolineServer', error)
|
||||
this.close()
|
||||
}
|
||||
|
||||
private onClientError = (error: Error) => {
|
||||
sendNonFatalException('trampolineClient', error)
|
||||
}
|
||||
}
|
||||
|
||||
export const trampolineServer = new TrampolineServer()
|
||||
|
|
Loading…
Reference in a new issue