From 8f2dcc6741660b38a5ab9d015a018d494f063843 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sat, 4 Aug 2012 00:03:11 +0200 Subject: [PATCH] Bug 6448 - carp on invalid barcode This is consistent with implementation of other barcode types which all carp instead of die on invalid barcodes. --- C4/Barcodes/EAN13.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/C4/Barcodes/EAN13.pm b/C4/Barcodes/EAN13.pm index da27c414f6..adc1283a67 100644 --- a/C4/Barcodes/EAN13.pm +++ b/C4/Barcodes/EAN13.pm @@ -24,6 +24,7 @@ use C4::Context; use C4::Debug; use Algorithm::CheckDigits; +use Carp; use vars qw($VERSION @ISA); use vars qw($debug $cgi_debug); # from C4::Debug, of course @@ -40,7 +41,8 @@ sub parse { if ( $ean->is_valid($barcode) ) { return ( '', $ean->basenumber($barcode), $ean->checkdigit($barcode) ); } else { - die "$barcode not valid EAN-13 barcode"; + carp "$barcode not valid EAN-13 barcode"; + return ( '', $barcode, '' ); } } -- 2.39.5