Catch TypeError when rendering 1d barcode

This commit is contained in:
Marcus Moore 2023-09-28 17:32:16 -07:00
parent 41eccaeae0
commit bed1055c4e

View file

@ -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);
}
}