diff --git a/server/utils/agents/aibitat/plugins/web-scraping.js b/server/utils/agents/aibitat/plugins/web-scraping.js index bc5f66cc4..ad35ce863 100644 --- a/server/utils/agents/aibitat/plugins/web-scraping.js +++ b/server/utils/agents/aibitat/plugins/web-scraping.js @@ -49,13 +49,14 @@ const webScraping = { if (url) return await this.scrape(url); return "There is nothing we can do. This function call returns no information."; } catch (error) { + const errorMessage = error?.message ?? JSON.stringify(error); this.super.handlerProps.log( - `Web Scraping Error: ${error.message}` + `Web Scraping Error: ${errorMessage}` ); this.super.introspect( - `${this.caller}: Web Scraping Error: ${error.message}` + `${this.caller}: Web Scraping Error: ${errorMessage}` ); - return `There was an error while calling the function. No data or response was found. Let the user know this was the error: ${error.message}`; + return `There was an error while calling the function. No data or response was found. Let the user know this was the error: ${errorMessage}`; } }, diff --git a/server/utils/agents/aibitat/providers/ai-provider.js b/server/utils/agents/aibitat/providers/ai-provider.js index ea8dc2b01..2a51bb16d 100644 --- a/server/utils/agents/aibitat/providers/ai-provider.js +++ b/server/utils/agents/aibitat/providers/ai-provider.js @@ -406,7 +406,9 @@ class Provider { ...config, }); default: - throw new Error(`Unsupported provider ${provider} for this task.`); + throw new Error( + `Unsupported provider ${JSON.stringify(provider)} for this task.` + ); } }