mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 08:34:07 -08:00
Exit only on ECONNREFUSED
and ENOTFOUND
This commit is contained in:
parent
fd728ab06a
commit
1bd0a6e381
|
@ -90,15 +90,15 @@ export abstract class TaskRunner {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.ws.addEventListener('error', (error) => {
|
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(
|
console.error(
|
||||||
`Error: Failed to connect to n8n. Please ensure n8n is reachable at: ${opts.n8nUri}`,
|
`Error: Failed to connect to n8n. Please ensure n8n is reachable at: ${opts.n8nUri}`,
|
||||||
);
|
);
|
||||||
|
process.exit(1);
|
||||||
} else {
|
} else {
|
||||||
console.error(`Error: Failed to connect to n8n at ${opts.n8nUri}`);
|
console.error(`Error: Failed to connect to n8n at ${opts.n8nUri}`);
|
||||||
console.error('Details:', error.message || 'Unknown error');
|
console.error('Details:', error.message || 'Unknown error');
|
||||||
}
|
}
|
||||||
process.exit(1);
|
|
||||||
});
|
});
|
||||||
this.ws.addEventListener('message', this.receiveMessage);
|
this.ws.addEventListener('message', this.receiveMessage);
|
||||||
this.ws.addEventListener('close', this.stopTaskOffers);
|
this.ws.addEventListener('close', this.stopTaskOffers);
|
||||||
|
|
Loading…
Reference in a new issue