From 228f167711813b3daac8f05a7744f6d0ccdd7fb4 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Sun, 8 Jul 2018 19:32:04 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Improve=20debug=20output?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ssn/extractFileStream.ts | 2 +- src/ssn/streams/getFileFromDisks.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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);