diff --git a/scripts/fetch-package.js b/scripts/fetch-package.js index c039820..ba51ae1 100644 --- a/scripts/fetch-package.js +++ b/scripts/fetch-package.js @@ -27,7 +27,10 @@ async function downloadToFile(url, filename) { if (!resp.body) throw new Error(`unexpected response has no body ${resp.statusText}`); await pipeline(resp.body, fs.createWriteStream(filename)); } catch (e) { - await fsPromises.unlink(filename).catch(); + console.error(e); + try { + await fsPromises.unlink(filename); + } catch (_) {} throw e; } }