From f04bc0b4c186f53e755f635b5d32c3a57affbd67 Mon Sep 17 00:00:00 2001 From: nguyentrungthat <80239428+nguentrungthat@users.noreply.github.com> Date: Wed, 12 Nov 2025 08:01:19 +0700 Subject: [PATCH] Update --- BACKEND/app/services/line_connection.ts | 4 ++-- BACKEND/providers/socket_io_provider.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/BACKEND/app/services/line_connection.ts b/BACKEND/app/services/line_connection.ts index 250ed82..b3838ec 100644 --- a/BACKEND/app/services/line_connection.ts +++ b/BACKEND/app/services/line_connection.ts @@ -146,9 +146,9 @@ export default class LineConnection { this.socketIO.emit('line_error', { stationId, lineId: id, - error: err.message + '\r\n', + error: '\n' + err.message + '\n', }) - reject(err) + resolve() }) this.client.on('close', () => { diff --git a/BACKEND/providers/socket_io_provider.ts b/BACKEND/providers/socket_io_provider.ts index 30548b3..6dea448 100644 --- a/BACKEND/providers/socket_io_provider.ts +++ b/BACKEND/providers/socket_io_provider.ts @@ -548,7 +548,8 @@ export class WebSocketIo { } } } catch (err: any) { - io.emit('line_error', { lineId, error: `[ERROR] ${err.message}\r\n`, stationId }) + this.lineConnecting = this.lineConnecting.filter((el) => el !== lineId) + io.emit('line_error', { lineId, error: `\n[ERROR] ${err.message}\n`, stationId }) } } }