Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision c46898c7

Von Sven Schöling vor mehr als 13 Jahren hinzugefügt

  • ID c46898c7a2328d211465818380178e25331d8f3c
  • Vorgänger bfb0d001
  • Nachfolger 09294068

Csv Errors sind nun Objekte mit entsprechendem Zugriff.

Unterschiede anzeigen:

SL/Helper/Csv.pm
14 14
) ];
15 15

  
16 16
use SL::Helper::Csv::Dispatcher;
17
use SL::Helper::Csv::Error;
17 18

  
18 19
# public interface
19 20

  
......
180 181

  
181 182
sub _push_error {
182 183
  my ($self, @errors) = @_;
183
  my @new_errors = ($self->errors, @errors);
184
  my @new_errors = ($self->errors, map { SL::Helper::Csv::Error->new(@$_) } @errors);
184 185
  $self->_errors(\@new_errors);
185 186
}
186 187

  
......
346 347
=head1 ERROR HANDLING
347 348

  
348 349
After parsing a file all errors will be accumulated into C<errors>.
350
Each entry is an object with the following attributes:
349 351

  
350
Each entry is an arrayref with the following structure:
351

  
352
 [
353
 0  offending raw input,
354
 1  Text::CSV error code if Text:CSV signalled an error, 0 else,
355
 2  error diagnostics,
356
 3  position in line,
357
 4  estimated line in file,
358
 ]
352
 raw_input:  offending raw input,
353
 code:   Text::CSV error code if Text:CSV signalled an error, 0 else,
354
 diag:   error diagnostics,
355
 line:   position in line,
356
 col:    estimated line in file,
359 357

  
360 358
Note that the last entry can be off, but will give an estimate.
361 359

  

Auch abrufbar als: Unified diff