@firefliesai/n8n-nodes-fireflies
Version:
An n8n integration for the Fireflies.ai API that enables workflow automation with meeting transcripts, analytics, summaries, and other conversation data from Fireflies.ai's AI meeting assistant.
50 lines • 2.05 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleOperationError = handleOperationError;
exports.handleGraphQLErrors = handleGraphQLErrors;
const n8n_workflow_1 = require("n8n-workflow");
const transport_1 = require("../transport");
function handleOperationError(node, error, continueOnFail, operationName) {
if (error instanceof transport_1.GraphQLApiError) {
if (!continueOnFail) {
handleGraphQLErrors(node, error.errors);
}
return {
success: false,
error: {
message: error.message,
type: 'GraphQL Error',
errors: error.errors.map(err => {
var _a, _b;
return ({
message: err.message,
code: err.code || ((_a = err.extensions) === null || _a === void 0 ? void 0 : _a.code),
correlationId: (_b = err.extensions) === null || _b === void 0 ? void 0 : _b.correlationId,
});
}),
timestamp: new Date().toISOString(),
},
};
}
if (!continueOnFail) {
throw error;
}
return {
success: false,
error: {
message: error.message,
type: 'System Error',
details: `Error in ${operationName}`,
timestamp: new Date().toISOString(),
},
};
}
function handleGraphQLErrors(node, graphqlErrors) {
const primaryError = graphqlErrors[0];
const description = graphqlErrors.map((err, index) => { var _a, _b; return `${index + 1}. ${err.message} (code: ${err.code || ((_a = err.extensions) === null || _a === void 0 ? void 0 : _a.code)}, correlationId: ${(_b = err.extensions) === null || _b === void 0 ? void 0 : _b.correlationId})`; }).join('\n');
throw new n8n_workflow_1.NodeOperationError(node, primaryError.message, {
message: primaryError.message,
description,
});
}
//# sourceMappingURL=errors.js.map