From 456dfabc6febea31ab11ce1bab22a4b51ac70c8a Mon Sep 17 00:00:00 2001 From: Darien Kindlund Date: Fri, 26 Jan 2024 13:48:09 -0500 Subject: [PATCH] For some reason, Airtable doesn't like the POST operations, so I need to add logging to figure out why this happens --- .../components/nodes/documentloaders/Airtable/Airtable.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/components/nodes/documentloaders/Airtable/Airtable.ts b/packages/components/nodes/documentloaders/Airtable/Airtable.ts index ed1572647..d0ed3b44a 100644 --- a/packages/components/nodes/documentloaders/Airtable/Airtable.ts +++ b/packages/components/nodes/documentloaders/Airtable/Airtable.ts @@ -71,7 +71,8 @@ class Airtable_DocumentLoaders implements INode { placeholder: 'Name, Assignee, fld1u0qUz0SoOQ9Gg, fldew39v6LBN5CjUl', optional: true, additionalParams: true, - description: 'Comma-separated list of field names or IDs to include. If empty, then ALL fields are used. Use field IDs if field names contain commas.' + description: + 'Comma-separated list of field names or IDs to include. If empty, then ALL fields are used. Use field IDs if field names contain commas.' }, { label: 'Return All', @@ -224,12 +225,15 @@ class AirtableLoader extends BaseDocumentLoader { 'Content-Type': 'application/json', Accept: 'application/json' } + console.log('Sending request to Airtable with data: ', data) const response = await axios.post(url, data, { headers }) return response.data } catch (error) { if (axios.isAxiosError(error)) { + console.error('Error response from Airtable:', error.response?.data) throw new Error(`Failed to fetch ${url} from Airtable: ${error.message}, status: ${error.response?.status}`) } else { + console.error('An unexpected error occurred:', error) throw new Error(`Failed to fetch ${url} from Airtable: ${error}`) } }