[AsarUpdate] Handle write error without erroring fully
This commit is contained in:
parent
70592854a8
commit
d53177898a
1 changed files with 13 additions and 0 deletions
|
@ -25,6 +25,15 @@ module.exports = () => { // (Try) update asar
|
|||
log('AsarUpdate', 'Original Hash:', originalHash);
|
||||
|
||||
const file = fs.createWriteStream(asarPath);
|
||||
|
||||
let writeError = false;
|
||||
file.on('error', err => {
|
||||
log('AsarUpdate', 'Failed to write', err);
|
||||
file.close();
|
||||
|
||||
writeError = true;
|
||||
});
|
||||
|
||||
log('AsarUpdate', 'Opened write stream to asar');
|
||||
|
||||
request(asarUrl, (_err, res) => {
|
||||
|
@ -61,5 +70,9 @@ Changed: ${changed}`);
|
|||
electron.app.exit();
|
||||
}
|
||||
}
|
||||
|
||||
if (writeError) {
|
||||
// Warn message?
|
||||
}
|
||||
});
|
||||
};
|
Loading…
Reference in a new issue