mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
⚡ Add continueOnFail support to SSH Node
This commit is contained in:
parent
a9184e38f8
commit
cd8f4247e6
|
@ -328,7 +328,7 @@ export class Ssh implements INodeType {
|
|||
}
|
||||
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
|
||||
try {
|
||||
if (resource === 'command') {
|
||||
|
||||
if (operation === 'execute') {
|
||||
|
@ -398,6 +398,23 @@ export class Ssh implements INodeType {
|
|||
returnData.push({ success: true });
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('error', error);
|
||||
if (this.continueOnFail()) {
|
||||
console.log('k1');
|
||||
if (resource === 'file' && operation === 'download') {
|
||||
items[i] = {
|
||||
json: {
|
||||
error: error.message,
|
||||
}
|
||||
};
|
||||
} else {
|
||||
returnData.push({ error: error.message });
|
||||
}
|
||||
continue;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
ssh.dispose();
|
||||
|
|
Loading…
Reference in a new issue