From f07cf79aba08e21a1fcce433464207338ce5cddb Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Sat, 15 Feb 2025 11:40:42 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Add=20error=20logging=20for=20un?= =?UTF-8?q?configured=20forged=20blocks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/bot-engine/src/forge/executeForgedBlock.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/bot-engine/src/forge/executeForgedBlock.ts b/packages/bot-engine/src/forge/executeForgedBlock.ts index 4a3606c22..52bcaf1e8 100644 --- a/packages/bot-engine/src/forge/executeForgedBlock.ts +++ b/packages/bot-engine/src/forge/executeForgedBlock.ts @@ -27,6 +27,15 @@ export const executeForgedBlock = async ( const blockDef = forgedBlocks[block.type]; if (!blockDef) return { outgoingEdgeId: block.outgoingEdgeId }; const action = blockDef.actions.find((a) => a.name === block.options.action); + if (!block.options || !action) + return { + outgoingEdgeId: block.outgoingEdgeId, + logs: [ + { + description: `${block.type} is not configured`, + }, + ], + }; const noCredentialsError = { status: "error", description: "Credentials not provided for integration",