From bed1055c4ef125946e3702dceec55ef7dfc0c71b Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 28 Sep 2023 17:32:16 -0700 Subject: [PATCH] Catch TypeError when rendering 1d barcode --- app/Models/Labels/Label.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Models/Labels/Label.php b/app/Models/Labels/Label.php index 9b48a7e730..69f67f6760 100644 --- a/app/Models/Labels/Label.php +++ b/app/Models/Labels/Label.php @@ -7,6 +7,7 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\File; use TCPDF; use TCPDF_STATIC; +use TypeError; /** * Model for Labels. @@ -372,7 +373,7 @@ abstract class Label if (empty($value)) return; try { $pdf->write1DBarcode($value, $type, $x, $y, $width, $height, null, ['stretch'=>true]); - } catch (\Exception $e) { + } catch (\Exception|TypeError $e) { \Log::error('The 1D barcode ' . $value . ' is not compliant with the barcode type '. $type); } }