Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 202433bf

Von Bernd Bleßmann vor fast 2 Jahren hinzugefügt

  • ID 202433bfa8c918efadf56292a52a1b320db666fd
  • Vorgänger 8482f5d5
  • Nachfolger d6176e1f

CSV-Helper: Fehler beim Erstellen der Objekte in Fehlerobjekt speichern

Unterschiede anzeigen:

SL/Helper/Csv.pm
315 315
  local $::myconfig{numberformat} = $self->numberformat if $self->numberformat;
316 316
  local $::myconfig{dateformat}   = $self->dateformat   if $self->dateformat;
317 317

  
318
  my $line_nr = 0;
318 319
  for my $line (@{ $self->_data }) {
319
    my $tmp_obj = $self->dispatcher->dispatch($line);
320
    push @objs, $tmp_obj;
320
    $line_nr++;
321
    eval {
322
      my $tmp_obj = $self->dispatcher->dispatch($line);
323
      push @objs, $tmp_obj;
324
      1;
325
    } or do {
326
      $self->_push_error([
327
        $line,
328
        0,
329
        "making objects failed: $@",
330
        0,
331
        $line_nr]);
332
    };
321 333
  }
322 334

  
323 335
  $self->_objects(\@objs);
......
442 454

  
443 455
This method will return an arrayref of all objects.
444 456

  
457
If an error occurs while making the objects, it is put errors, too.
458

  
445 459
=item C<get_data>
446 460

  
447 461
Returns an arrayref of the raw lines as hashrefs.
448 462

  
449 463
=item C<errors>
450 464

  
451
Return all errors that came up during parsing. See error handling for detailed
452
information.
465
Return all errors that came up during parsing or making objects.
466
See error handling for detailed information.
453 467

  
454 468
=back
455 469

  
......
642 656
Error handling is also known to break on new Perl versions and need to be
643 657
adjusted from time to time due to changes in Text::CSV_XS.
644 658

  
659
If an error occurs while making the objects, it is put into errors, too.
660
Here the line is also an estimation.
661

  
645 662
=head1 CAVEATS
646 663

  
647 664
=over 4

Auch abrufbar als: Unified diff