From 42c0fa9a5a947f8ff2d57f1e90ad1de76b242686 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 18 Sep 2019 16:58:02 +0200 Subject: [PATCH] web2image control phantomjs flow --- pandora_console/include/web2image.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/web2image.js b/pandora_console/include/web2image.js index bf183a73c4..09f840e45e 100644 --- a/pandora_console/include/web2image.js +++ b/pandora_console/include/web2image.js @@ -61,6 +61,7 @@ page.onConsoleMessage = function(msg) { page.onError = function(msg) { console.log(msg); page.close(); + phantom.exit(); }; page.onCallback = function(st) { @@ -74,4 +75,9 @@ page.onCallback = function(st) { phantom.exit(); }; -page.open(url, "POST", post_data, function(status) {}); +page.open(url, "POST", post_data, function(status) { + if (status == "fail") { + console.out("Failed to generate chart."); + phantom.exit(); + } +});