diff --git a/server/services/ocp/controller/labeling/bookIn.ts b/server/services/ocp/controller/labeling/bookIn.ts index 21477ab..6b6f3be 100644 --- a/server/services/ocp/controller/labeling/bookIn.ts +++ b/server/services/ocp/controller/labeling/bookIn.ts @@ -96,7 +96,7 @@ export const bookInLabel = async (data: any) => { "ocp", `${ data.printer ? data.printer[0].name : "Manual book in" - }, "Error: ${error}` + }, "Error: ${error?.response.data}` ); // console.log(error.response.data); return { diff --git a/server/services/ocp/controller/labeling/labelProcess.ts b/server/services/ocp/controller/labeling/labelProcess.ts index b4cd319..89c22d1 100644 --- a/server/services/ocp/controller/labeling/labelProcess.ts +++ b/server/services/ocp/controller/labeling/labelProcess.ts @@ -12,6 +12,7 @@ import { bookInLabel } from "./bookIn.js"; import { delieryInhouse } from "../specialProcesses/inhouse/inhouseDelivery.js"; import { dualPrintingProcess } from "../specialProcesses/dualPrinting/dualPrinting.js"; import { getMac } from "../../utils/getMachineId.js"; +import { success } from "zod/v4"; interface Printer { name: string; @@ -283,6 +284,20 @@ export const labelingProcess = async ({ // will add later!!! :P } + if (!book.success) { + // createLog( + // "error", + // "labeling", + // "ocp", + // `Error Booking in label: ${book.errors[0].message}` + // ); + return { + success: false, + message: `Error Booking in label: ${book.errors[0].message}`, + data: book, + }; + } + // inhouse - if the inhouse funtion is turned on we will deliver to inhouse as long as we did not hit an error state const inhouseDelivery = settingData.filter( (s) => s.name === "inhouseDelivery"