diff --git a/lib/content/write.js b/lib/content/write.js index c713634..ff0d15a 100644 --- a/lib/content/write.js +++ b/lib/content/write.js @@ -112,7 +112,7 @@ function pipeToTmp (inputStream, cache, tmpTarget, opts, errCheck) { errCheck() return pipe(inputStream, hashStream, outStream).then(() => { return {integrity, size} - }, err => { + }).catch(err => { return rimraf(tmpTarget).then(() => { throw err }) }) })