From 1bd0a6e38127c68824fa32dbab81fa1b0513ee47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Thu, 7 Nov 2024 18:17:24 +0100 Subject: [PATCH] Exit only on `ECONNREFUSED` and `ENOTFOUND` --- packages/@n8n/task-runner/src/task-runner.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@n8n/task-runner/src/task-runner.ts b/packages/@n8n/task-runner/src/task-runner.ts index f6e5d0eb25..7fea7869e2 100644 --- a/packages/@n8n/task-runner/src/task-runner.ts +++ b/packages/@n8n/task-runner/src/task-runner.ts @@ -90,15 +90,15 @@ export abstract class TaskRunner { }); this.ws.addEventListener('error', (error) => { - if (error.message?.includes('ECONNREFUSED') || error.message?.includes('ETIMEDOUT')) { + if (error.message?.includes('ECONNREFUSED') || error.message?.includes('ENOTFOUND')) { console.error( `Error: Failed to connect to n8n. Please ensure n8n is reachable at: ${opts.n8nUri}`, ); + process.exit(1); } else { console.error(`Error: Failed to connect to n8n at ${opts.n8nUri}`); console.error('Details:', error.message || 'Unknown error'); } - process.exit(1); }); this.ws.addEventListener('message', this.receiveMessage); this.ws.addEventListener('close', this.stopTaskOffers);