record import error handling improvements
authorberick <berick@esilibrary.com>
Thu, 5 May 2011 14:01:22 +0000 (10:01 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 6 Jul 2011 18:50:52 +0000 (14:50 -0400)
Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm

index 759a624..3755ad2 100644 (file)
@@ -752,6 +752,8 @@ sub import_record_list_impl {
 
         $report_args{progress}++;
         $report_args{e} = $e;
+        $report_args{import_error} = undef;
+        $report_args{evt} = undef;
 
         my $rec = $e->$retrieve_func([
             $rec_id,
@@ -912,15 +914,14 @@ sub import_record_list_impl {
                 }
 
                 if($U->event_code($record)) {
-                    my $import_error = 'import.duplicate.tcn' if $record->{textcode} eq 'TCN_EXISTS';
-                    finish_rec_import_attempt(%report_args, import_error => $import_error, evt => $record);
+                    $report_args{import_error} = 'import.duplicate.tcn' if $record->{textcode} eq 'TCN_EXISTS';
+                    $report_args{evt} = $record;
 
                 } else {
 
                     $logger->info("vl: successfully imported new $type record");
                     $rec->imported_as($record->id);
                     $rec->import_time('now');
-
                     $imported = 1 if $e->$update_func($rec);
                 }
             }