mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-26 01:35:14 +02:00
split gunzip and untar errors
This commit is contained in:
parent
7dbdc9ca0a
commit
db4f1a8acb
1 changed files with 7 additions and 2 deletions
|
@ -571,7 +571,7 @@ function maybeInstallDefaultContentSet(onComplete) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
req.pipe(zlib.createGunzip()).pipe(tar.extract(getRootHifiDataDirectory())).on('error', function(){
|
function extractError(err) {
|
||||||
console.log("Aborting request because gunzip/untar failed");
|
console.log("Aborting request because gunzip/untar failed");
|
||||||
aborted = true;
|
aborted = true;
|
||||||
req.abort();
|
req.abort();
|
||||||
|
@ -580,7 +580,12 @@ function maybeInstallDefaultContentSet(onComplete) {
|
||||||
sendStateUpdate('error', {
|
sendStateUpdate('error', {
|
||||||
message: "Error installing resources."
|
message: "Error installing resources."
|
||||||
});
|
});
|
||||||
}).on('finish', function(){
|
}
|
||||||
|
|
||||||
|
var gunzip = zlib.createGunzip();
|
||||||
|
gunzip.on('error', extractError);
|
||||||
|
|
||||||
|
req.pipe(gunzip).pipe(tar.extract(getRootHifiDataDirectory())).on('error', extractError).on('finish', function(){
|
||||||
// response and decompression complete, return
|
// response and decompression complete, return
|
||||||
console.log("Done", arguments);
|
console.log("Done", arguments);
|
||||||
sendStateUpdate('complete');
|
sendStateUpdate('complete');
|
||||||
|
|
Loading…
Reference in a new issue