request no longer throw errors

This commit is contained in:
David Frank 2016-05-26 02:20:38 +08:00
parent 2a6e656c1d
commit 30b95dc6b8
1 changed files with 1 additions and 7 deletions

View File

@ -48,13 +48,7 @@ function Fetch(url, opts) {
// wrap http.request into fetch
return new Fetch.Promise(function(resolve, reject) {
// build request object
var options;
try {
options = new Request(url, opts);
} catch (err) {
reject(err);
return;
}
var options = new Request(url, opts);
if (!options.protocol || !options.hostname) {
throw new Error('only absolute urls are supported');