From 1345a8c67c41a31847c0dea23a7e7904bf25779a Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Wed, 28 Jan 2015 00:07:03 +0100 Subject: log error on console, if api returns an error --- lib/providermanager.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/providermanager.js b/lib/providermanager.js index 1a550e5f4..25cd14288 100644 --- a/lib/providermanager.js +++ b/lib/providermanager.js @@ -76,6 +76,12 @@ ProviderManager.prototype.send = function(data) { //TODO: handle error here? var result = this.provider.send(data); result = JSON.parse(result); + + if (result.error) { + console.log(result.error); + return null; + } + return result.result; }; -- cgit v1.2.3