From 161601d3d767f2c590a9a797e69eb5913aee8712 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Sun, 30 Sep 2018 14:48:30 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Improve=20error=20messaging?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ssn/getPatch.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ssn/getPatch.ts b/src/ssn/getPatch.ts index e7efe69..7f29c5f 100644 --- a/src/ssn/getPatch.ts +++ b/src/ssn/getPatch.ts @@ -91,7 +91,7 @@ export default async function getPatch({ product, from, to, sourceDirectory, tar fs.rename(outputNameTemp, outputName, (renameError) => { if (renameError) { - throw new Error(`Could not rename output file "${outputNameTemp}": ${renameError.name}`); + throw new Error(`Could not rename output file "${outputNameTemp}": ${renameError.message}`); } }); } catch (error) { @@ -115,18 +115,18 @@ export default async function getPatch({ product, from, to, sourceDirectory, tar if (sourceDir === targetDir) { fs.unlink(sourceFile, (deleteError) => { if (deleteError) { - throw new Error(`Could not delete old source file "${sourceFile}": ${deleteError.name}`); + throw new Error(`Could not delete old source file "${sourceFile}": ${deleteError.message}`); } fs.rename(outputNameTemp, outputName, (renameError) => { if (renameError) { - throw new Error(`Could not rename output file "${outputNameTemp}": ${renameError.name}`); + throw new Error(`Could not rename output file "${outputNameTemp}": ${renameError.message}`); } }); }); } else { fs.rename(outputNameTemp, outputName, (renameError) => { if (renameError) { - throw new Error(`Could not rename output file "${outputNameTemp}": ${renameError.name}`); + throw new Error(`Could not rename output file "${outputNameTemp}": ${renameError.message}`); } }); }