You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by GitBox <gi...@apache.org> on 2018/03/23 00:51:49 UTC
[GitHub] mistercrunch commented on a change in pull request #4654: Expose metrics to JS
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:
users@infra.apache.org
With regards,
Apache Git Services