Show error message box when failed to save file

For #390
This commit is contained in:
Yuya Ochiai
2017-04-27 23:33:20 +09:00
parent 95c574eadc
commit 4c30d23ce9
2 changed files with 5 additions and 1 deletions

View File

@@ -35,7 +35,7 @@ function getAttachmentName(headers) {
function saveResponseBody(response, filename, callback) {
const output = fs.createWriteStream(filename);
output.on('close', callback).on('error', callback);
output.on('close', callback);
switch (response.headers['content-encoding']) {
case 'gzip':
response.pipe(zlib.createGunzip()).pipe(output).on('error', callback);