Changeset 22852
- Timestamp:
- 2010-09-06T11:47:57+12:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/MetadataCSVPlugin.pm
r20804 r22852 30 30 use BasePlugin; 31 31 use strict; 32 32 no strict 'refs'; 33 33 use multiread; 34 34 … … 108 108 print STDERR "\n<Processing n='$file' p='MetadataCSVPlugin'>\n" if ($gli); 109 109 print STDERR "MetadataCSVPlugin: processing $file\n" if ($self->{'verbosity'}) > 1; 110 111 my $outhandle = $self->{'outhandle'}; 112 my $failhandle = $self->{'failhandle'}; 110 113 111 114 # add the file to the block list so that it won't be processed in read, as we will do all we can with it here … … 136 139 137 140 if (!$found_filename_field) { 138 print STDERR "MetadataCSVPlugin Error: No Filename field in CSV file: $filename\n";141 $self->print_error($outhandle, $failhandle, $gli, $filename, "No Filename field in CSV file"); 139 142 return -1; # error 140 143 } … … 171 174 # The line must be formatted incorrectly 172 175 else { 173 print STDERR "MetadataCSVPlugin Error: Badly formatted CSV line: $csv_line.\n";176 $self->print_error($outhandle, $failhandle, $gli, $filename, "Badly formatted CSV line: $csv_line"); 174 177 last; 175 178 } … … 181 184 my $csv_line_filename_array = $csv_line_metadata{"Filename"}; 182 185 if (!defined $csv_line_filename_array) { 183 print STDERR "MetadataCSVPlugin Error: No Filename metadata in CSV line: $orig_csv_line\n";186 $self->print_error($outhandle, $failhandle, $gli, $filename, "No Filename metadata in CSV line: $orig_csv_line"); 184 187 next; 185 188 } … … 202 205 } 203 206 204 207 sub print_error 208 { 209 210 my $self = shift(@_); 211 my ($outhandle, $failhandle, $gli, $file, $error) = @_; 212 213 print $outhandle "MetadataCSVPlugin Error: $file: $error\n"; 214 print $failhandle "MetadataCSVPlugin Error: $file: $error\n"; 215 print STDERR "<ProcessingError n='$file' r='$error'/>\n" if ($gli); 216 } 205 217 1;
Note:
See TracChangeset
for help on using the changeset viewer.