diff --git a/index.js b/index.js index 82f5ed7..c6ed343 100644 --- a/index.js +++ b/index.js @@ -186,7 +186,8 @@ function setDefaults(defs) { debug(finalOpts); req = http.request(finalOpts, onResponse); } else { - throw new Error("unknown protocol: '" + opts.uri.protocol + "'"); + cb(new Error("unknown protocol: '" + opts.uri.protocol + "'")); + return; } req.on('error', function (e) {