From a39f428912cb92904997453466df9d6ce644d773 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Tue, 10 Jul 2018 00:59:31 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Improve=20error=20messaging?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cdn/downloadUrlContents.ts | 2 +- src/ssn/xdelta3/performDiffing.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cdn/downloadUrlContents.ts b/src/cdn/downloadUrlContents.ts index d179d54..efe910a 100644 --- a/src/cdn/downloadUrlContents.ts +++ b/src/cdn/downloadUrlContents.ts @@ -24,7 +24,7 @@ export default function downloadUrlContents({ host, path, size }: {host: string, //Create HTTP request const request = http.request({ family: 4, - host, + hostname: host, path, }, saveResponse.bind(null, tempFileName, resolve, (reason: string) => { request.abort(); reject(reason); })); diff --git a/src/ssn/xdelta3/performDiffing.ts b/src/ssn/xdelta3/performDiffing.ts index 4feba87..f1c3e31 100644 --- a/src/ssn/xdelta3/performDiffing.ts +++ b/src/ssn/xdelta3/performDiffing.ts @@ -14,6 +14,10 @@ export default function performDiffing(sourceFile: string, diffStream: stream.Re reject(`Error during xdelta3: ${chunk}`); }); + process.on('error', (error) => { + reject(`Error during xdelta3: ${error}`); + }); + process.on('exit', (code, signal) => { if (code === 0) { resolve();