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'
|
responseType: 'buffer'
|
||||||
}).catch(error => console.log(`[ERROR] ${error.name}: ${error.code||error.message}`)));
|
}).catch(error => console.log(`[ERROR] ${error.name}: ${error.code||error.message}`)));
|
||||||
|
|
||||||
if (!res.body) { return; }
|
if (!res.body) { return new Error("Invalid State"); }
|
||||||
|
try {
|
||||||
let dec = key.update(res.body);
|
let dec = key.update(res.body);
|
||||||
dec = Buffer.concat([dec, key.final()]);
|
dec = Buffer.concat([dec, key.final()]);
|
||||||
return { content: dec, index: index};
|
return { content: dec, index: index};
|
||||||
|
} catch (e) { return e }
|
||||||
}
|
}
|
||||||
|
|
||||||
let keys = {};
|
let keys = {};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue