From 9e44ebe415d7225df98f461e6f0a8bb6da2d417c Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Fri, 27 Dec 2024 20:56:23 +0800 Subject: [PATCH] fix: remove unwanted error logging --- server/src/containers/docker.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/containers/docker.ts b/server/src/containers/docker.ts index 03d4183..0d488eb 100644 --- a/server/src/containers/docker.ts +++ b/server/src/containers/docker.ts @@ -94,20 +94,21 @@ export async function attachContainer( config.docker.network ].IPAddress + let error: Error | null = null for (let i = 0; i < 10; i++) { try { // eslint-disable-next-line no-await-in-loop const stream = await connectToSSH(containerIp, { token }) return stream } catch (err) { - logger.error('Failed to connect to SSH', err) + error = err as Error // eslint-disable-next-line no-await-in-loop await new Promise((resolve) => { setTimeout(resolve, 1000) }) } } - throw new Error('Failed to connect to SSH') + throw new Error('Failed to connect to SSH', { cause: error }) } export async function deleteContainer(id: string) {