Handle errors in mq-hls by rejecting promise on job error

This commit is contained in:
srgooglo 2025-07-04 14:49:24 +02:00
parent b721a403f5
commit ac155b38e3

View File

@ -2,7 +2,7 @@ import path from "node:path"
import MultiqualityHLSJob from "@shared-classes/MultiqualityHLSJob"
export default async ({ filePath, workPath, onProgress }) => {
return new Promise(async (resolve, reject) => {
return new Promise((resolve, reject) => {
const outputDir = path.resolve(workPath, "mqhls")
const job = new MultiqualityHLSJob({
@ -40,6 +40,10 @@ export default async ({ filePath, workPath, onProgress }) => {
}
})
job.on("error", (error) => {
reject(error)
})
job.run()
})
}