From ac155b38e3e71b7604e59c8c4e8eacc491cc3743 Mon Sep 17 00:00:00 2001 From: srgooglo Date: Fri, 4 Jul 2025 14:49:24 +0200 Subject: [PATCH] Handle errors in mq-hls by rejecting promise on job error --- packages/server/classes/Transformation/handlers/mq-hls.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/server/classes/Transformation/handlers/mq-hls.js b/packages/server/classes/Transformation/handlers/mq-hls.js index e10ea1d0..93bf924d 100644 --- a/packages/server/classes/Transformation/handlers/mq-hls.js +++ b/packages/server/classes/Transformation/handlers/mq-hls.js @@ -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() }) }