refactor: Remove usless catch blocks, and add a linting rule to prevent them (no-changelog) (#12730)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2025-01-20 18:20:04 +01:00
committed by GitHub
parent 4ee4552b0e
commit 202da76380
17 changed files with 220 additions and 242 deletions

View File

@@ -392,13 +392,9 @@ export const createVectorStoreNode = (args: VectorStoreNodeConstructorArgs) =>
);
resultData.push(...serializedDocuments);
try {
await args.populateVectorStore(this, embeddings, processedDocuments, itemIndex);
await args.populateVectorStore(this, embeddings, processedDocuments, itemIndex);
logAiEvent(this, 'ai-vector-store-populated');
} catch (error) {
throw error;
}
logAiEvent(this, 'ai-vector-store-populated');
}
return [resultData];
@@ -443,16 +439,12 @@ export const createVectorStoreNode = (args: VectorStoreNodeConstructorArgs) =>
resultData.push(...serializedDocuments);
try {
// Use ids option to upsert instead of insert
await vectorStore.addDocuments(processedDocuments, {
ids: [documentId],
});
// Use ids option to upsert instead of insert
await vectorStore.addDocuments(processedDocuments, {
ids: [documentId],
});
logAiEvent(this, 'ai-vector-store-updated');
} catch (error) {
throw error;
}
logAiEvent(this, 'ai-vector-store-updated');
}
return [resultData];