From c8e590419e5994c116299c511050089613c42f9c Mon Sep 17 00:00:00 2001 From: Ajax Davis Date: Fri, 12 Dec 2025 05:53:47 +1000 Subject: [PATCH] fix(executor): move startTime declaration before try block The startTime variable was declared inside the try block but referenced in the catch block, causing 'startTime is not defined' errors when exceptions occurred before line 404 (e.g., during req.json() parsing). Moving the declaration before the try ensures it's in scope for the catch block's executionTimeMs calculation. --- apps/railway-executor/server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/railway-executor/server.ts b/apps/railway-executor/server.ts index e554638..cb6d645 100644 --- a/apps/railway-executor/server.ts +++ b/apps/railway-executor/server.ts @@ -378,6 +378,7 @@ async function loadAndDescribe(req: Request): Promise { * Execute a tool with parameters */ async function executeTool(req: Request): Promise { + const startTime = Date.now(); try { const body = await req.json(); const { packageName, exportName, version, importUrl, params, env } = body; @@ -401,7 +402,6 @@ async function executeTool(req: Request): Promise { } const cacheKey = `${packageName}::${exportName}`; - const startTime = Date.now(); // biome-ignore lint/suspicious/noImplicitAnyLet: Tool type is determined dynamically after import let toolModule;