gf3 / sandbox

A nifty JavaScript sandbox for Node.js
ISC License
844 stars 123 forks source link

How to distinguish normal vs exceptional results? #44

Open greg-dennis opened 8 years ago

greg-dennis commented 8 years ago

Right now, it seems difficult to distinguish normal vs exceptional results. How hard would it be to add an additional field to "output", like "output.error", that would be set if and only if an exception were raised. Looking at the code, some cases would be easy to handle, including:

But what about valid code that logs some stdout but then raises an error itself? Can this kind of exceptional result be detected?