From 45898deb1a194a59c9ca150b5d77585d97afd567 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 18 Aug 2023 22:18:38 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20500=20if=20the=201D=20barcode?= =?UTF-8?q?=20doesn=E2=80=99t=20match=20the=20format=20requested=20-=20log?= =?UTF-8?q?=20an=20error=20instead?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: snipe --- app/Models/Labels/Label.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Models/Labels/Label.php b/app/Models/Labels/Label.php index ff759ac544..9b48a7e730 100644 --- a/app/Models/Labels/Label.php +++ b/app/Models/Labels/Label.php @@ -370,7 +370,11 @@ abstract class Label */ public final function write1DBarcode(TCPDF $pdf, $value, $type, $x, $y, $width, $height) { if (empty($value)) return; - $pdf->write1DBarcode($value, $type, $x, $y, $width, $height, null, ['stretch'=>true]); + try { + $pdf->write1DBarcode($value, $type, $x, $y, $width, $height, null, ['stretch'=>true]); + } catch (\Exception $e) { + \Log::error('The 1D barcode ' . $value . ' is not compliant with the barcode type '. $type); + } } /**