mirror of
https://github.com/ragestudio/comty.git
synced 2025-07-08 08:44:15 +00:00
Handle errors in mq-hls by rejecting promise on job error
This commit is contained in:
parent
b721a403f5
commit
ac155b38e3
@ -2,7 +2,7 @@ import path from "node:path"
|
|||||||
import MultiqualityHLSJob from "@shared-classes/MultiqualityHLSJob"
|
import MultiqualityHLSJob from "@shared-classes/MultiqualityHLSJob"
|
||||||
|
|
||||||
export default async ({ filePath, workPath, onProgress }) => {
|
export default async ({ filePath, workPath, onProgress }) => {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const outputDir = path.resolve(workPath, "mqhls")
|
const outputDir = path.resolve(workPath, "mqhls")
|
||||||
|
|
||||||
const job = new MultiqualityHLSJob({
|
const job = new MultiqualityHLSJob({
|
||||||
@ -40,6 +40,10 @@ export default async ({ filePath, workPath, onProgress }) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
job.on("error", (error) => {
|
||||||
|
reject(error)
|
||||||
|
})
|
||||||
|
|
||||||
job.run()
|
job.run()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user