From: Dobrica Pavlinusic Date: Fri, 3 Aug 2012 22:03:11 +0000 (+0200) Subject: Bug 6448 - carp on invalid barcode X-Git-Tag: v3.10.01~369^2 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=8f2dcc6741660b38a5ab9d015a018d494f063843;p=koha_fer Bug 6448 - carp on invalid barcode This is consistent with implementation of other barcode types which all carp instead of die on invalid barcodes. --- 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, '' ); } }