Commit fc9566b3a2c93fc5f470b663a3be05ff99b640f6
Add more output for HTTP failures
cel committed on 12/1/2019, 5:38:10 AMParent: d66bbc88625c75a18132a506bcd522775047b1c9
Files changed
bin.js | changed |
bin.js | ||
---|---|---|
@@ -58,9 +58,12 @@ | ||
58 | 58 … | + (userAgentBot ? ' bot' : '') |
59 | 59 … | } |
60 | 60 … | var h = opts.protocol === 'https:' ? https : http |
61 | 61 … | h.get(opts, function (res) { |
62 | - if (res.statusCode !== 200) return cb(new Error('HTTP ' + res.statusCode + ' ' + res.statusMessage)) | |
62 … | + if (res.statusCode !== 200) { | |
63 … | + console.error(res.headers, url) | |
64 … | + return cb(new Error('HTTP ' + res.statusCode + ' ' + res.statusMessage)) | |
65 … | + } | |
63 | 66 … | var bufs = [] |
64 | 67 … | res.on('data', function (buf) { |
65 | 68 … | bufs.push(buf) |
66 | 69 … | }) |
Built with git-ssb-web