Fix Github error override commit [952a5bd87c]

This commit is contained in:
David Négrier 2022-04-13 11:24:15 +02:00 committed by CEC
parent 5466bd1d68
commit 320c68c88e

View File

@ -123,7 +123,13 @@ export class SocketManager implements ZoneEventListener {
}
})
.on("end", () => {
console.warn("Admin connection lost to back server");
console.warn(
"Admin connection lost to back server '" +
apiClient.getChannel().getTarget() +
"' for room '" +
roomId +
"'"
);
// Let's close the front connection if the back connection is closed. This way, we can retry connecting from the start.
if (!client.disconnecting) {
this.closeWebsocketConnection(client, 1011, "Admin Connection lost to back server");
@ -131,7 +137,14 @@ export class SocketManager implements ZoneEventListener {
console.log("A user left");
})
.on("error", (err: Error) => {
console.error("Error in connection to back server:", err);
console.error(
"Error in connection to back server '" +
apiClient.getChannel().getTarget() +
"' for room '" +
roomId +
"':",
err
);
if (!client.disconnecting) {
this.closeWebsocketConnection(client, 1011, "Error while connecting to back server");
}
@ -188,7 +201,7 @@ export class SocketManager implements ZoneEventListener {
joinRoomMessage.addCharacterlayer(characterLayerMessage);
}
console.log("Calling joinRoom");
console.log("Calling joinRoom '" + client.roomId + "'");
const apiClient = await apiClientRepository.getClient(client.roomId);
const streamToPusher = apiClient.joinRoom();
clientEventsEmitter.emitClientJoin(client.userUuid, client.roomId);
@ -216,7 +229,13 @@ export class SocketManager implements ZoneEventListener {
}
})
.on("end", () => {
console.warn("Connection lost to back server");
console.warn(
"Connection lost to back server '" +
apiClient.getChannel().getTarget() +
"' for room '" +
client.roomId +
"'"
);
// Let's close the front connection if the back connection is closed. This way, we can retry connecting from the start.
if (!client.disconnecting) {
this.closeWebsocketConnection(client, 1011, "Connection lost to back server");
@ -224,7 +243,14 @@ export class SocketManager implements ZoneEventListener {
console.log("A user left");
})
.on("error", (err: Error) => {
console.error("Error in connection to back server:", err);
console.error(
"Error in connection to back server '" +
apiClient.getChannel().getTarget() +
"' for room '" +
client.roomId +
"':",
err
);
if (!client.disconnecting) {
this.closeWebsocketConnection(client, 1011, "Error while connecting to back server");
}