handle transformations errors

This commit is contained in:
SrGooglo 2025-06-16 20:39:25 +00:00
parent 12a9b8eba8
commit 92051c4d3a

View File

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