From 478e57eab849ce4ec475f4b396f4dd3dca72e1c7 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 files changed, 3 insertions(+), 1 deletions(-) diff --git a/C4/Barcodes/EAN13.pm b/C4/Barcodes/EAN13.pm index da27c41..adc1283 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, '' ); } } -- 1.7.2.5