From 6ecfaa9df5d1f2ef44cd18078300b344ed1d0ab0 Mon Sep 17 00:00:00 2001 From: Katrina Scialdone Date: Mon, 4 Sep 2023 18:23:24 -0600 Subject: [PATCH] Fix erroring functions causing a compile error If a function's implementation creates a Javascript error, it would return as a compile error due to the `error` variable being shadowed internally by this try-catch. This commit fixes that, as well as clarifies the fixed error messages with "internal error". --- app/imports/parser/parseTree/call.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/imports/parser/parseTree/call.js b/app/imports/parser/parseTree/call.js index 24b7d3c9..83536fe4 100644 --- a/app/imports/parser/parseTree/call.js +++ b/app/imports/parser/parseTree/call.js @@ -104,12 +104,12 @@ const call = { // Resolve the return value return resolve(fn, value, scope, context); } - } catch (error) { - context.error(error.message || error); + } catch (err) { + context.error(`Internal error: ${err.message || err}`); return { result: error.create({ node: node, - error: error.message || error, + error: `Internal error: ${err.message || err}`, }), context, }