use callback not throw
This commit is contained in:
parent
28e67055e7
commit
94eec37646
3
index.js
3
index.js
|
@ -186,7 +186,8 @@ function setDefaults(defs) {
|
||||||
debug(finalOpts);
|
debug(finalOpts);
|
||||||
req = http.request(finalOpts, onResponse);
|
req = http.request(finalOpts, onResponse);
|
||||||
} else {
|
} else {
|
||||||
throw new Error("unknown protocol: '" + opts.uri.protocol + "'");
|
cb(new Error("unknown protocol: '" + opts.uri.protocol + "'"));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
req.on('error', function (e) {
|
req.on('error', function (e) {
|
||||||
|
|
Loading…
Reference in New Issue