🎨 Improve debug output

This commit is contained in:
C-3PO 2018-07-08 19:32:04 +02:00
parent f6eb334602
commit 228f167711
Signed by: c3po
GPG key ID: 62993C4BB4D86F24
2 changed files with 2 additions and 2 deletions

View file

@ -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);

View file

@ -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);