diff --git a/src/ssn/extractFileStream.ts b/src/ssn/extractFileStream.ts index 169cec0..55d9024 100644 --- a/src/ssn/extractFileStream.ts +++ b/src/ssn/extractFileStream.ts @@ -25,7 +25,7 @@ export default function extractFileStream(file: ISsnFileEntry, inputStream: stre const decompressTransform = zlib.createInflateRaw(); decompressTransform.on('error', (error) => { //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); diff --git a/src/ssn/streams/getFileFromDisks.ts b/src/ssn/streams/getFileFromDisks.ts index 1aebc3f..6ef0332 100644 --- a/src/ssn/streams/getFileFromDisks.ts +++ b/src/ssn/streams/getFileFromDisks.ts @@ -34,7 +34,7 @@ export default async function getFileFromDisks(disks: string[], { diskStart, off if (readTooManyBytes === 0) { outputStream.end(chunk); } 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 shortenedChunk = new Buffer(shortenedLength); shortenedChunk.fill(chunk, 0, shortenedLength);