Don’t 500 if the 1D barcode doesn’t match the format requested - log an error instead

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2023-08-18 22:18:38 +01:00
parent ffc7c4e99a
commit 45898deb1a

View file

@ -370,7 +370,11 @@ abstract class Label
*/ */
public final function write1DBarcode(TCPDF $pdf, $value, $type, $x, $y, $width, $height) { public final function write1DBarcode(TCPDF $pdf, $value, $type, $x, $y, $width, $height) {
if (empty($value)) return; if (empty($value)) return;
try {
$pdf->write1DBarcode($value, $type, $x, $y, $width, $height, null, ['stretch'=>true]); $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);
}
} }
/** /**