From 68f8acd9223fc6a91088b1c9b21094368a153c6f Mon Sep 17 00:00:00 2001 From: walterhiggins Date: Wed, 23 Jan 2013 00:50:16 +0000 Subject: [PATCH] More informative errors when evaluating javascript files --- src/main/javascript/core/_scriptcraft.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/javascript/core/_scriptcraft.js b/src/main/javascript/core/_scriptcraft.js index 4bbdadd..233d315 100644 --- a/src/main/javascript/core/_scriptcraft.js +++ b/src/main/javascript/core/_scriptcraft.js @@ -56,7 +56,11 @@ var verbose = verbose || false; var reader = new java.io.FileReader(file); __engine.put("__script",canonizedFilename); __engine.put("__folder",(parent?_canonize(parent):"")+"/"); - result = __engine.eval(reader); + try{ + result = __engine.eval(reader); + }catch (e){ + __plugin.logger.severe("Error evaluating " + filename + ", " + e ); + } }else{ if (warnOnFileNotFound) __plugin.logger.warning(canonizedFilename + " not found");