mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Install: log errors with more obvious prefix
This commit is contained in:
parent
08a25a0c8f
commit
fe0767df13
@ -4,6 +4,10 @@
|
||||
|
||||
Requires libvips v8.10.6
|
||||
|
||||
### v0.28.1 - TBD
|
||||
|
||||
* Ensure all installation errors are logged with a more obvious prefix.
|
||||
|
||||
### v0.28.0 - 29th March 2021
|
||||
|
||||
* Prebuilt binaries now include mozjpeg and libimagequant (BSD 2-Clause).
|
||||
|
@ -145,7 +145,9 @@ try {
|
||||
tmpFileStream
|
||||
.on('error', function (err) {
|
||||
// Clean up temporary file
|
||||
fs.unlinkSync(tarPathTemp);
|
||||
try {
|
||||
fs.unlinkSync(tarPathTemp);
|
||||
} catch (e) {}
|
||||
fail(err);
|
||||
})
|
||||
.on('close', function () {
|
||||
@ -157,7 +159,7 @@ try {
|
||||
fs.copyFileSync(tarPathTemp, tarPathCache);
|
||||
fs.unlinkSync(tarPathTemp);
|
||||
}
|
||||
extractTarball(tarPathCache);
|
||||
extractTarball(tarPathCache, platformAndArch);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -39,7 +39,7 @@ const cachePath = function () {
|
||||
|
||||
const log = function (item) {
|
||||
if (item instanceof Error) {
|
||||
console.error(`sharp: ${item.message}`);
|
||||
console.error(`sharp: Installation error: ${item.message}`);
|
||||
} else {
|
||||
console.log(`sharp: ${item}`);
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ describe('libvips binaries', function () {
|
||||
|
||||
it('logs an error message', function (done) {
|
||||
console.error = function (msg) {
|
||||
assert.strictEqual(msg, 'sharp: problem');
|
||||
assert.strictEqual(msg, 'sharp: Installation error: problem');
|
||||
done();
|
||||
};
|
||||
libvips.log(new Error('problem'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user