From 2463eb442f0db43abe73a3e0d4cacc88f2149f92 Mon Sep 17 00:00:00 2001 From: Sayo Date: Sun, 12 Jan 2025 21:06:50 +0530 Subject: [PATCH] Update packages/plugin-nft-collections/src/actions/get-collections.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../plugin-nft-collections/src/actions/get-collections.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/plugin-nft-collections/src/actions/get-collections.ts b/packages/plugin-nft-collections/src/actions/get-collections.ts index ba381b410c..5a601f5216 100644 --- a/packages/plugin-nft-collections/src/actions/get-collections.ts +++ b/packages/plugin-nft-collections/src/actions/get-collections.ts @@ -39,10 +39,13 @@ export const getCollectionsAction = ( }); return true; } catch (error) { - console.error("Error fetching NFT collections:", error); + const errorMessage = error instanceof Error + ? `Failed to fetch NFT collections: ${error.message}` + : "An unexpected error occurred while fetching NFT collections."; + console.error(errorMessage); await runtime.messageManager.createMemory({ id: message.id, - content: { text: "Failed to fetch NFT collection data." }, + content: { text: errorMessage }, roomId: message.roomId, userId: message.userId, agentId: runtime.agentId,