From dce90378443b9710ca9d8bb3e44e58c0a421ab6d Mon Sep 17 00:00:00 2001 From: serafettin Date: Mon, 15 Jul 2024 20:12:03 -0400 Subject: [PATCH] Iterate --- api/src/agents/basic_subscriber.js | 2 +- api/src/libs/indexer.js | 9 +++++---- api/src/services/embedding.js | 1 - 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/src/agents/basic_subscriber.js b/api/src/agents/basic_subscriber.js index 69ec2b15..2b855536 100644 --- a/api/src/agents/basic_subscriber.js +++ b/api/src/agents/basic_subscriber.js @@ -68,6 +68,6 @@ export const handleNewItemEvent = async ( ); } } catch (e) { - console.log(e); + console.log(e.message); } }; diff --git a/api/src/libs/indexer.js b/api/src/libs/indexer.js index f5c36554..690d9460 100644 --- a/api/src/libs/indexer.js +++ b/api/src/libs/indexer.js @@ -115,10 +115,11 @@ class Indexer { vector: embeddingResponse.data.vector, description: "Default document embeddings", }); - - logger.info( - `Step [0]: EmbeddingEvent trigger successful for id: ${embedding.id}`, - ); + if (embedding) { + logger.info( + `Step [0]: EmbeddingEvent trigger successful for id: ${embedding.id}`, + ); + } } catch (e) { logger.error( `Step [0]: Indexer createIndexItemEvent error: ${JSON.stringify(e)}`, diff --git a/api/src/services/embedding.js b/api/src/services/embedding.js index 2a4e2fd7..aa8624fb 100644 --- a/api/src/services/embedding.js +++ b/api/src/services/embedding.js @@ -233,7 +233,6 @@ export class EmbeddingService { } catch (error) { // Log the error and rethrow it for external handling console.error("Exception occurred in createEmbedding:", error); - throw error; } }