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);