🎨 Improve debug output
This commit is contained in:
parent
f6eb334602
commit
228f167711
2 changed files with 2 additions and 2 deletions
|
@ -25,7 +25,7 @@ export default function extractFileStream(file: ISsnFileEntry, inputStream: stre
|
||||||
const decompressTransform = zlib.createInflateRaw();
|
const decompressTransform = zlib.createInflateRaw();
|
||||||
decompressTransform.on('error', (error) => {
|
decompressTransform.on('error', (error) => {
|
||||||
//TODO: need to throw error sync, not async
|
//TODO: need to throw error sync, not async
|
||||||
throw new Error(`Error during decompression: ${error.message}`);
|
throw new Error(`Error during decompression of "${file.name}": ${error.message}`);
|
||||||
});
|
});
|
||||||
curStream = curStream.pipe(decompressTransform);
|
curStream = curStream.pipe(decompressTransform);
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ export default async function getFileFromDisks(disks: string[], { diskStart, off
|
||||||
if (readTooManyBytes === 0) {
|
if (readTooManyBytes === 0) {
|
||||||
outputStream.end(chunk);
|
outputStream.end(chunk);
|
||||||
} else {
|
} else {
|
||||||
//We must shorten the chunk, write the shortened chunk and the end the stream
|
//We must shorten the chunk, write the shortened chunk and then end the stream
|
||||||
const shortenedLength = chunk.length - readTooManyBytes;
|
const shortenedLength = chunk.length - readTooManyBytes;
|
||||||
const shortenedChunk = new Buffer(shortenedLength);
|
const shortenedChunk = new Buffer(shortenedLength);
|
||||||
shortenedChunk.fill(chunk, 0, shortenedLength);
|
shortenedChunk.fill(chunk, 0, shortenedLength);
|
||||||
|
|
Loading…
Reference in a new issue