feat: Better error handling on segment download side

This commit is contained in:
nima.taheri@hootsuite.com 2022-08-10 12:27:27 -07:00
parent 9987b838b6
commit b8fe708f77

@ -122,6 +122,10 @@ function combineSegments(type, i, segmentsUrl, output, filename, downloadingFlag
let req = https
.get(segmentsUrl[i], res => {
if (res.statusCode != 200) {
cb(new Error(`Downloading segment with url '${segmentsUrl[i]}' failed with status: ${res.statusCode} ${res.statusMessage}`))
}
res.on("data", d => output.write(d));
res.on("end", () =>