mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
add error handling for unknon operations
This commit is contained in:
parent
4f1a096139
commit
819efc50e5
|
@ -1026,6 +1026,8 @@ export class ActiveCampaign implements INodeType {
|
||||||
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||||
addAdditionalFields(body.contact as IDataObject, updateFields);
|
addAdditionalFields(body.contact as IDataObject, updateFields);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
throw new Error(`The operation ${operation} is not known`);
|
||||||
}
|
}
|
||||||
} else if (resource === 'deal') {
|
} else if (resource === 'deal') {
|
||||||
if (operation === 'create') {
|
if (operation === 'create') {
|
||||||
|
@ -1101,6 +1103,9 @@ export class ActiveCampaign implements INodeType {
|
||||||
|
|
||||||
dataKey = 'deals';
|
dataKey = 'deals';
|
||||||
endpoint = `/api/3/deals`;
|
endpoint = `/api/3/deals`;
|
||||||
|
} else {
|
||||||
|
throw new Error(`The operation ${operation} is not known`);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`The resource "${resource}" is not known!`);
|
throw new Error(`The resource "${resource}" is not known!`);
|
||||||
}
|
}
|
||||||
|
@ -1121,4 +1126,4 @@ export class ActiveCampaign implements INodeType {
|
||||||
|
|
||||||
return [this.helpers.returnJsonArray(returnData)];
|
return [this.helpers.returnJsonArray(returnData)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue