From 5bcfdc853b2ff5a2390da3de30b006f85f5c837c Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 10 Jun 2017 20:42:29 +0000 Subject: Release of version 1.1.2. --- docs/index.js.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'docs/index.js.html') diff --git a/docs/index.js.html b/docs/index.js.html index 1916ba5..467ffac 100644 --- a/docs/index.js.html +++ b/docs/index.js.html @@ -69,7 +69,10 @@ function connect(uuid, callback) { const request = http.request(query, function(response) { var json = ''; response.on('data', (raw) => json = decryptJSON(raw)); - response.on('end', () => callback(json.result)); + response.on('end', () => { + if (json.error) throw new Error(json.error.message); + callback(json.result); + }); }); request.on('error', (error) => Error(error.message)); @@ -100,7 +103,10 @@ function send(raw, callback) { const request = http.request(query, function(response) { var json = ''; response.on('data', (raw) => json = decryptJSON(raw)); - response.on('end', () => callback(json.result)); + response.on('end', () => { + if (json.error) throw new Error(json.error.message); + callback(json.result); + }); }); request.on('error', (error) => Error(error)); @@ -219,7 +225,7 @@ function isVerification(data) {
-- cgit v1.2.3