🎨 Improve error messaging
This commit is contained in:
parent
3a3fa68213
commit
a39f428912
2 changed files with 5 additions and 1 deletions
|
@ -24,7 +24,7 @@ export default function downloadUrlContents({ host, path, size }: {host: string,
|
||||||
//Create HTTP request
|
//Create HTTP request
|
||||||
const request = http.request({
|
const request = http.request({
|
||||||
family: 4,
|
family: 4,
|
||||||
host,
|
hostname: host,
|
||||||
path,
|
path,
|
||||||
}, saveResponse.bind(null, tempFileName, resolve, (reason: string) => { request.abort(); reject(reason); }));
|
}, saveResponse.bind(null, tempFileName, resolve, (reason: string) => { request.abort(); reject(reason); }));
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,10 @@ export default function performDiffing(sourceFile: string, diffStream: stream.Re
|
||||||
reject(`Error during xdelta3: ${chunk}`);
|
reject(`Error during xdelta3: ${chunk}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
process.on('error', (error) => {
|
||||||
|
reject(`Error during xdelta3: ${error}`);
|
||||||
|
});
|
||||||
|
|
||||||
process.on('exit', (code, signal) => {
|
process.on('exit', (code, signal) => {
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
resolve();
|
resolve();
|
||||||
|
|
Loading…
Reference in a new issue