LP
1502152: Improve marc_export warnings.
Trap warnings from MARC libraries in marc_export so we can report the
id of the record that triggered the warning.
Use warn to print our warnings, instead of print STDERR. This includes
the existing errors, trapped by eval, that were being printed to STDERR.
To test
-------
[1] Ensure that a record has an error that would become apparent
during export. An easy way to do this is to insert the "‡"
character in the contents of a subfield, then use
--encoding MARC8 when exporting the record.
[2] Run the MARC export, e.g.,
cat id_list | marc_export -i > /tmp/bibs.mrc
[3] Verify that a warning is reported, e.g.,
Warning from bibliographic record 1: no mapping found at position 0...
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>