From 94eec37646bd407731b941ceaea38901897a5428 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 26 Jun 2018 14:43:56 -0600 Subject: [PATCH] use callback not throw --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) {