🎨 Improve error messaging
This commit is contained in:
parent
d60c9097ab
commit
161601d3d7
1 changed files with 4 additions and 4 deletions
|
@ -91,7 +91,7 @@ export default async function getPatch({ product, from, to, sourceDirectory, tar
|
||||||
|
|
||||||
fs.rename(outputNameTemp, outputName, (renameError) => {
|
fs.rename(outputNameTemp, outputName, (renameError) => {
|
||||||
if (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) {
|
} catch (error) {
|
||||||
|
@ -115,18 +115,18 @@ export default async function getPatch({ product, from, to, sourceDirectory, tar
|
||||||
if (sourceDir === targetDir) {
|
if (sourceDir === targetDir) {
|
||||||
fs.unlink(sourceFile, (deleteError) => {
|
fs.unlink(sourceFile, (deleteError) => {
|
||||||
if (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) => {
|
fs.rename(outputNameTemp, outputName, (renameError) => {
|
||||||
if (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 {
|
} else {
|
||||||
fs.rename(outputNameTemp, outputName, (renameError) => {
|
fs.rename(outputNameTemp, outputName, (renameError) => {
|
||||||
if (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}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue