Skip to content

Commit

Permalink
[cli] Reject template download if statusCode is not 2xx (#1638)
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Nov 29, 2019
1 parent ae4de9b commit 6c9d0a9
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ function getZip(url) {
return
}

if (res.statusCode > 299) {
const httpErr = ['HTTP', res.statusCode, res.statusMessage].filter(Boolean).join(' ')
reject(new Error(`${httpErr} trying to download ${url}`))
return
}

resolve(decompress(data))
})
})
Expand Down

0 comments on commit 6c9d0a9

Please sign in to comment.