From 7907df22a1394362070e8a896a3592b10f1de5d5 Mon Sep 17 00:00:00 2001 From: Mark Wilson Date: Wed, 6 Jan 2016 17:15:54 -0800 Subject: [PATCH] Cleanup --- carelink.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/carelink.js b/carelink.js index 3592a70..744be9f 100644 --- a/carelink.js +++ b/carelink.js @@ -3,8 +3,7 @@ var _ = require('lodash'), common = require('common'), - request = require('request'), - zlib = require('zlib'); + request = require('request'); var logger = require('./logger'); @@ -129,11 +128,13 @@ var Client = exports.Client = function (options) { } function parseData(response, next) { + var parsed; try { - next(null, JSON.parse(response.body)); + parsed = JSON.parse(response.body); } catch (e) { next(e); } + next(null, parsed); } function firstFetch(callback) {