jordwalke / esy-issues

Easy ISSUES
MIT License
49 stars 5 forks source link

Better error when a dependency's url is invalid #56

Open chenglou opened 7 years ago

chenglou commented 7 years ago

Right now it gives:

(node:98869) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: fetch failed with status code 404
Error: fetch failed with status code 404
    at Request.<anonymous> (/usr/local/lib/node_modules/esy/node_modules/npm-registry-client/lib/fetch.js:58:14)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at Request.onRequestResponse (/usr/local/lib/node_modules/esy/node_modules/request/request.js:986:10)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at HTTPParser.parserOnIncomingClient (_http_client.js:472:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
    at TLSSocket.socketOnData (_http_client.js:361:20)
    at emitOne (events.js:96:13)
    at TLSSocket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at TLSSocket.Readable.push (_stream_readable.js:134:10)
    at TLSWrap.onread (net.js:543:20)