Error handling
This commit is contained in:
parent
0fbb200417
commit
b519ecf4f3
1 changed files with 6 additions and 5 deletions
11
funi.js
11
funi.js
|
|
@ -783,11 +783,12 @@ async function downloadPart(chunk, index) {
|
|||
responseType: 'buffer'
|
||||
}).catch(error => console.log(`[ERROR] ${error.name}: ${error.code||error.message}`)));
|
||||
|
||||
if (!res.body) { return; }
|
||||
|
||||
let dec = key.update(res.body);
|
||||
dec = Buffer.concat([dec, key.final()]);
|
||||
return { content: dec, index: index};
|
||||
if (!res.body) { return new Error("Invalid State"); }
|
||||
try {
|
||||
let dec = key.update(res.body);
|
||||
dec = Buffer.concat([dec, key.final()]);
|
||||
return { content: dec, index: index};
|
||||
} catch (e) { return e }
|
||||
}
|
||||
|
||||
let keys = {};
|
||||
|
|
|
|||
Loading…
Reference in a new issue