From 30b95dc6b85298a07bdb9f35d4a15c9f2ad37a82 Mon Sep 17 00:00:00 2001 From: David Frank Date: Thu, 26 May 2016 02:20:38 +0800 Subject: [PATCH] request no longer throw errors --- index.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/index.js b/index.js index f633f33..10fb8ff 100644 --- a/index.js +++ b/index.js @@ -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');