"use strict";
var _ = require('lodash'),
    request = require('request');

module.exports = function (url, headers) {
    var defer = Promise.defer();
    request({url, headers})
        .on('response', function (_response) {
            _response.pause();
            defer.resolve({
                read: function * () {
                    var chunk;
                    while (null !== (chunk = _response.read())) {
                        yield chunk;
                    }
                }
            });
        });

    return defer.promise;
};
@@ -216,24 +216,138 @@
 response) %7B%0A
+            if(_response.statusCode !== 200)%7B%0A                throw Error(_response.statusMessage);%0A            %7D%0A
             

handle non 200 responses