Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mddub committed Jan 7, 2016
1 parent 2e8b5ac commit 7907df2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions carelink.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

var _ = require('lodash'),
common = require('common'),
request = require('request'),
zlib = require('zlib');
request = require('request');

var logger = require('./logger');

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 7907df2

Please sign in to comment.