Catch error for barcode scanner