🔧 jobResult aggregate query first draft

This commit is contained in:
2023-08-28 23:56:44 -04:00
parent 76d4e6b10f
commit c718456adc
2 changed files with 22 additions and 7 deletions

View File

@@ -47,6 +47,7 @@ import {
getMimeType,
} from "../utils/file.utils";
import { convertXMLToJSON } from "./xml.utils";
const { MoleculerError } = require("moleculer").Errors;
const fse = require("fs-extra");
const Unrar = require("unrar");
interface RarFile {
@@ -367,7 +368,9 @@ export const extractFromArchive = async (filePath: string) => {
console.error(
"Error inferring filetype for comicinfo.xml extraction."
);
throw new Error("Cannot infer filetype");
throw new MoleculerError({}, 500, "FILETYPE_INFERENCE_ERROR", {
data: { message: "Cannot infer filetype."},
});
}
};