From 3a1fa515ec7e89ee1a58ac931cdf8ee0d8780db6 Mon Sep 17 00:00:00 2001 From: shahrul Date: Wed, 14 Jun 2023 11:18:20 +0800 Subject: [PATCH] added inspect to error --- scripts/ingest-data.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/ingest-data.ts b/scripts/ingest-data.ts index 28edf47d6..17f7fb8c1 100644 --- a/scripts/ingest-data.ts +++ b/scripts/ingest-data.ts @@ -5,6 +5,7 @@ import { pinecone } from '@/utils/pinecone-client'; import { PDFLoader } from 'langchain/document_loaders/fs/pdf'; import { PINECONE_INDEX_NAME, PINECONE_NAME_SPACE } from '@/config/pinecone'; import { DirectoryLoader } from 'langchain/document_loaders/fs/directory'; +import { inspect } from "util"; /* Name of directory to retrieve your files from Make sure to add your PDF files inside the 'docs' folder @@ -42,7 +43,7 @@ export const run = async () => { textKey: 'text', }); } catch (error) { - console.log('error', error); + console.log('error', inspect(error, false, 9, true)); throw new Error('Failed to ingest your data'); } };