From 2f49490b3d1032a4eb4e94a76d432a3ab1d0ef67 Mon Sep 17 00:00:00 2001 From: Giuseppe La Torre Date: Mon, 8 Jul 2013 18:14:44 +0200 Subject: [PATCH 1/2] Handled exception for empty stdout --- lib/sandbox.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/sandbox.js b/lib/sandbox.js index 62e7aba..7c5d7c5 100644 --- a/lib/sandbox.js +++ b/lib/sandbox.js @@ -23,7 +23,12 @@ function Sandbox( options ) { child.stdout.on( 'data', output ) child.on( 'exit', function( code ) { clearTimeout( timer ) - hollaback.call( this, JSON.parse( stdout ) ) + try{ + hollaback.call( this, JSON.parse( stdout ) ) + } + catch(err){ + console.log("Malformed stdout. ERR : " + err) + } }) // Go From cc3f919b023154c4781f3dcb3563262c00f7938a Mon Sep 17 00:00:00 2001 From: Giuseppe La Torre Date: Tue, 9 Jul 2013 14:27:25 +0200 Subject: [PATCH 2/2] Changed default timeout --- lib/sandbox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sandbox.js b/lib/sandbox.js index 7c5d7c5..01de76a 100644 --- a/lib/sandbox.js +++ b/lib/sandbox.js @@ -44,7 +44,7 @@ function Sandbox( options ) { // Options Sandbox.options = - { timeout: 500 + { timeout: 1000 , node: 'node' , shovel: path.join( __dirname, 'shovel.js' ) }