mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
⚡ Add continueOnFail to Google Calendar (#1722)
* ⚡ Add continueOnFail to Google Calendar * ⚡ Minor improvements Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
parent
c972f3dd50
commit
469b92e32a
|
@ -180,6 +180,7 @@ export class GoogleCalendar implements INodeType {
|
|||
const resource = this.getNodeParameter('resource', 0) as string;
|
||||
const operation = this.getNodeParameter('operation', 0) as string;
|
||||
for (let i = 0; i < length; i++) {
|
||||
try {
|
||||
if (resource === 'calendar') {
|
||||
//https://developers.google.com/calendar/v3/reference/freebusy/query
|
||||
if (operation === 'availability') {
|
||||
|
@ -605,6 +606,19 @@ export class GoogleCalendar implements INodeType {
|
|||
);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
if (this.continueOnFail() !== true) {
|
||||
throw error;
|
||||
} else {
|
||||
// Return the actual reason as error
|
||||
returnData.push(
|
||||
{
|
||||
error: error.message,
|
||||
},
|
||||
);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (Array.isArray(responseData)) {
|
||||
returnData.push.apply(returnData, responseData as IDataObject[]);
|
||||
|
|
Loading…
Reference in a new issue