Provisioner improvements
This commit is contained in:
parent
ee03a10f64
commit
4e8f02e6e6
1 changed files with 7 additions and 4 deletions
|
@ -458,7 +458,8 @@ export class Provisioner {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info(`Provisioner: socket closed, code=${code}, reason=${reason}`);
|
const logId = `Provisioner.#handleClose(${index})`;
|
||||||
|
log.info(`${logId}: closed, code=${code}, reason=${reason}`);
|
||||||
|
|
||||||
// Is URL from the socket displayed as a QR code?
|
// Is URL from the socket displayed as a QR code?
|
||||||
const isActive = index === this.#sockets.length - 1;
|
const isActive = index === this.#sockets.length - 1;
|
||||||
|
@ -466,18 +467,20 @@ export class Provisioner {
|
||||||
|
|
||||||
// Graceful closure
|
// Graceful closure
|
||||||
if (state === SocketState.Done) {
|
if (state === SocketState.Done) {
|
||||||
log.info('Provisioner: socket closed gracefully');
|
log.info(`${logId}: closed gracefully`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isActive) {
|
if (isActive) {
|
||||||
log.info('Provisioner: active socket closed');
|
log.info(`${logId}: active socket closed`);
|
||||||
this.#notify({
|
this.#notify({
|
||||||
kind:
|
kind:
|
||||||
state === SocketState.WaitingForUuid
|
state === SocketState.WaitingForUuid
|
||||||
? EventKind.ConnectError
|
? EventKind.ConnectError
|
||||||
: EventKind.EnvelopeError,
|
: EventKind.EnvelopeError,
|
||||||
error: new Error(`Socket closed, code=${code}, reason=${reason}`),
|
error: new Error(
|
||||||
|
`Socket ${index} closed, code=${code}, reason=${reason}`
|
||||||
|
),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue