diff --git a/bigquery.js b/bigquery.js index 6d2b4da..7f51b0d 100644 --- a/bigquery.js +++ b/bigquery.js @@ -84,14 +84,14 @@ module.exports = function(RED) { // We do not have a static query try { const results = await bigquery.query(query); + msg.payload = results[0]; + node.send(msg); } catch(error) { node.error('Error, unable to execute query.'); return; } - msg.payload = results[0]; - node.send(msg); } // Input if (credentials) { @@ -118,4 +118,4 @@ module.exports = function(RED) { RED.nodes.registerType(NODE_TYPE, BigQueryNode); -}; \ No newline at end of file +};