diff --git a/packages/string-templates/src/helpers/javascript.ts b/packages/string-templates/src/helpers/javascript.ts index d5183ef3ed..ed8d4ad6d7 100644 --- a/packages/string-templates/src/helpers/javascript.ts +++ b/packages/string-templates/src/helpers/javascript.ts @@ -126,7 +126,10 @@ export function processJS(handlebars: string, context: any) { throw error } - // If all else fails, generic error message. + if (error.name === "SyntaxError") { + return error.toString() + } + return "Error while executing JS" } }