🎨 Improve error messaging

This commit is contained in:
C-3PO 2018-07-10 00:59:31 +02:00
parent 3a3fa68213
commit a39f428912
Signed by: c3po
GPG key ID: 62993C4BB4D86F24
2 changed files with 5 additions and 1 deletions

View file

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

View file

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