{"action":"created","issue":{"url":"https://api.github.com/repos/asvd/jailed/issues/24","repository_url":"https://api.github.com/repos/asvd/jailed","labels_url":"https://api.github.com/repos/asvd/jailed/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/asvd/jailed/issues/24/comments","events_url":"https://api.github.com/repos/asvd/jailed/issues/24/events","html_url":"https://github.com/asvd/jailed/issues/24","id":135230255,"number":24,"title":"Node dies with unhandled exception on jailed plugin syntax error","user":{"login":"janesconference","id":315834,"avatar_url":"https://avatars.githubusercontent.com/u/315834?v=3","gravatar_id":"","url":"https://api.github.com/users/janesconference","html_url":"https://github.com/janesconference","followers_url":"https://api.github.com/users/janesconference/followers","following_url":"https://api.github.com/users/janesconference/following{/other_user}","gists_url":"https://api.github.com/users/janesconference/gists{/gist_id}","starred_url":"https://api.github.com/users/janesconference/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janesconference/subscriptions","organizations_url":"https://api.github.com/users/janesconference/orgs","repos_url":"https://api.github.com/users/janesconference/repos","events_url":"https://api.github.com/users/janesconference/events{/privacy}","received_events_url":"https://api.github.com/users/janesconference/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-02-21T17:22:08Z","updated_at":"2016-02-21T18:31:43Z","closed_at":null,"body":"I'm using \r\n\r\n    pluginInstance = new jailed.DynamicPlugin(script, api)\r\n\r\nand \r\n\r\n    pluginInstance.whenFailed(function() {\r\n       // Handle plugin failing\r\n     })\r\n\r\nbut, if script has a syntax error, the process dies with an unhandled exception:\r\n\r\n    SyntaxError: Unexpected token }\r\n        at Object.exports.runInNewContext (vm.js:48:16)\r\n        at executeJailed (/myDir/node_modules/jailed/lib/_pluginNode.js:194:12)\r\n        at execute (/myDir/node_modules/jailed/lib/_pluginNode.js:143:5)\r\n        at process.<anonymous> (/myDir/node_modules/jailed/lib/_pluginNode.js:36:9)\r\n        at emitTwo (events.js:100:13)\r\n        at process.emit (events.js:185:7)\r\n        at handleMessage (internal/child_process.js:689:10)\r\n        at Pipe.channel.onread (internal/child_process.js:440:11)\r\n\r\nIs there a way to handle this without the process dying?"},"comment":{"url":"https://api.github.com/repos/asvd/jailed/issues/comments/186881831","html_url":"https://github.com/asvd/jailed/issues/24#issuecomment-186881831","issue_url":"https://api.github.com/repos/asvd/jailed/issues/24","id":186881831,"user":{"login":"janesconference","id":315834,"avatar_url":"https://avatars.githubusercontent.com/u/315834?v=3","gravatar_id":"","url":"https://api.github.com/users/janesconference","html_url":"https://github.com/janesconference","followers_url":"https://api.github.com/users/janesconference/followers","following_url":"https://api.github.com/users/janesconference/following{/other_user}","gists_url":"https://api.github.com/users/janesconference/gists{/gist_id}","starred_url":"https://api.github.com/users/janesconference/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janesconference/subscriptions","organizations_url":"https://api.github.com/users/janesconference/orgs","repos_url":"https://api.github.com/users/janesconference/repos","events_url":"https://api.github.com/users/janesconference/events{/privacy}","received_events_url":"https://api.github.com/users/janesconference/received_events","type":"User","site_admin":false},"created_at":"2016-02-21T18:31:43Z","updated_at":"2016-02-21T18:31:43Z","body":"Yep, it is."}}