diff --git a/index.js b/index.js index a17ead8..f886769 100644 --- a/index.js +++ b/index.js @@ -85,12 +85,13 @@ async function vpnConnect(vpnName) { } } catch (error) { - consoleLog(`[${host}] Failed to connect to VPN: ${vpnName}. Retrying (attempt ${attempt} of ${maxAttempts})...`, 'error'); + consoleLog(`[${host}] Catch error: Failed to connect to VPN: ${vpnName}. Retrying (attempt ${attempt} of ${maxAttempts})...`, 'error'); await sleep(1000); } } consoleLog(`[${host}] Maximum number of connection attempts reached. Failed to connect to VPN: ${vpnName}`, 'error'); + await vpnDisconnect(); return 1; }