mistercrunch commented on a change in pull request #4654: Expose metrics to JS
URL: 
https://github.com/apache/incubator-superset/pull/4654#discussion_r176614337
 
 

 ##########
 File path: superset/assets/javascripts/modules/sandbox.js
 ##########
 @@ -22,6 +22,10 @@ export default function sandboxedEval(code, context, opts) {
   Object.keys(sandboxContext).forEach(function (key) {
     sandbox[key] = sandboxContext[key];
   });
-  vm.runInNewContext(codeToEval, sandbox, opts);
-  return sandbox[resultKey];
+  try {
+    vm.runInNewContext(codeToEval, sandbox, opts);
+    return sandbox[resultKey];
+  } catch (error) {
+    return () => error;
 
 Review comment:
   Why returning a function that returns an error?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to