mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01: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");
|
||||
aborted = true;
|
||||
req.abort();
|
||||
|
@ -580,7 +580,12 @@ function maybeInstallDefaultContentSet(onComplete) {
|
|||
sendStateUpdate('error', {
|
||||
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
|
||||
console.log("Done", arguments);
|
||||
sendStateUpdate('complete');
|
||||
|
|
Loading…
Reference in a new issue