diff --git a/src/backend/ssh/server-stats.ts b/src/backend/ssh/server-stats.ts index 1dfd27e3..73911848 100644 --- a/src/backend/ssh/server-stats.ts +++ b/src/backend/ssh/server-stats.ts @@ -123,7 +123,9 @@ class SSHConnectionPool { if (!conn.inUse && now - conn.lastUsed > maxAge) { try { conn.client.end(); - } catch {} + } catch { + // Ignore errors when closing stale connections + } return false; } return true; @@ -143,7 +145,9 @@ class SSHConnectionPool { for (const conn of connections) { try { conn.client.end(); - } catch {} + } catch { + // Ignore errors when closing connections during cleanup + } } } this.connections.clear(); @@ -181,7 +185,9 @@ class RequestQueue { if (request) { try { await request(); - } catch (error) {} + } catch { + // Ignore errors from queued requests + } } } @@ -829,7 +835,9 @@ function tcpPing( settled = true; try { socket.destroy(); - } catch {} + } catch { + // Ignore errors when destroying socket + } resolve(result); }; diff --git a/src/backend/utils/auto-ssl-setup.ts b/src/backend/utils/auto-ssl-setup.ts index e2d1034a..5d9a6fc8 100644 --- a/src/backend/utils/auto-ssl-setup.ts +++ b/src/backend/utils/auto-ssl-setup.ts @@ -234,7 +234,9 @@ IP.3 = 0.0.0.0 let envContent = ""; try { envContent = await fs.readFile(this.ENV_FILE, "utf8"); - } catch {} + } catch { + // File doesn't exist yet, will create with SSL config + } let updatedContent = envContent; let hasChanges = false; diff --git a/src/backend/utils/ssh-key-utils.ts b/src/backend/utils/ssh-key-utils.ts index b19f95c9..9a9f813d 100644 --- a/src/backend/utils/ssh-key-utils.ts +++ b/src/backend/utils/ssh-key-utils.ts @@ -84,7 +84,9 @@ function detectKeyTypeFromContent(keyContent: string): string { } else if (decodedString.includes("1.3.101.112")) { return "ssh-ed25519"; } - } catch (error) {} + } catch { + // Cannot decode key, fallback to length-based detection + } if (content.length < 800) { return "ssh-ed25519"; @@ -140,7 +142,9 @@ function detectPublicKeyTypeFromContent(publicKeyContent: string): string { } else if (decodedString.includes("1.3.101.112")) { return "ssh-ed25519"; } - } catch (error) {} + } catch { + // Cannot decode key, fallback to length-based detection + } if (content.length < 400) { return "ssh-ed25519"; @@ -242,7 +246,9 @@ export function parseSSHKey( useSSH2 = true; } - } catch (error) {} + } catch { + // SSH2 parsing failed, will use fallback method + } } if (!useSSH2) { @@ -268,7 +274,9 @@ export function parseSSHKey( success: true, }; } - } catch (fallbackError) {} + } catch { + // Fallback parsing also failed + } return { privateKey: privateKeyData, diff --git a/src/backend/utils/system-crypto.ts b/src/backend/utils/system-crypto.ts index 689a3137..9f9c15b0 100644 --- a/src/backend/utils/system-crypto.ts +++ b/src/backend/utils/system-crypto.ts @@ -115,7 +115,9 @@ class SystemCrypto { process.env.INTERNAL_AUTH_TOKEN = tokenMatch[1]; return; } - } catch {} + } catch { + // Ignore file read errors, will generate new token + } await this.generateAndGuideInternalAuthToken(); } catch (error) {