View | Details | Raw Unified | Return to bug 36942
Collapse All | Expand All

(-)a/Koha/ERM/EHoldings/Title.pm (-2 / +1 lines)
Lines 136-143 sub read_file { Link Here
136
    unless ( $csv->eof() ) {
136
    unless ( $csv->eof() ) {
137
        my ( $cde, $str, $pos ) = $csv->error_diag();
137
        my ( $cde, $str, $pos ) = $csv->error_diag();
138
        my $error = $cde ? "$cde, $str, $pos" : "";
138
        my $error = $cde ? "$cde, $str, $pos" : "";
139
        warn $error if $error;
139
        Koha::Exceptions::FileNotParsed->throw( filename => $file->{filename}, error => $error );
140
        return ( $column_headers, $lines, $error );
141
    }
140
    }
142
141
143
    return ( $column_headers, $lines, '' );
142
    return ( $column_headers, $lines, '' );
(-)a/Koha/Exceptions.pm (+5 lines)
Lines 20-25 use Exception::Class ( Link Here
20
        description => 'File not found',
20
        description => 'File not found',
21
        fields      => ['filename'],
21
        fields      => ['filename'],
22
    },
22
    },
23
    'Koha::Exceptions::FileNotParsed' => {
24
        isa         => 'Koha::Exception',
25
        description => 'File could not be parsed',
26
        fields      => [ 'filename', 'error' ],
27
    },
23
    'Koha::Exceptions::InvalidStatus' => {
28
    'Koha::Exceptions::InvalidStatus' => {
24
        isa         => 'Koha::Exception',
29
        isa         => 'Koha::Exception',
25
        description => 'The current status is not valid in context',
30
        description => 'The current status is not valid in context',
(-)a/t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t (-5 / +3 lines)
Lines 21-26 use Test::NoWarnings; Link Here
21
use Test::More tests => 9;
21
use Test::More tests => 9;
22
use Test::MockModule;
22
use Test::MockModule;
23
use Test::Warn;
23
use Test::Warn;
24
use Test::Exception;
24
25
25
use Koha::Database;
26
use Koha::Database;
26
use Koha::BackgroundJobs;
27
use Koha::BackgroundJobs;
Lines 136-145 Nature Plants,,2055-0278,2015-01,1,1,,,,https://www.nature.com/nplants,,4aaa7,,f Link Here
136
Nature Astronomy,,2397-3366,2017-01,1,1,,,,https://www.nature.com/natastron,,4bbb0,,fulltext,Hybrid (Open Choice),Nature Publishing Group UK,serial,,,,,,,,P"
137
Nature Astronomy,,2397-3366,2017-01,1,1,,,,https://www.nature.com/natastron,,4bbb0,,fulltext,Hybrid (Open Choice),Nature Publishing Group UK,serial,,,,,,,,P"
137
        )
138
        )
138
    };
139
    };
139
    warning_is {
140
140
        Koha::ERM::EHoldings::Title::read_file($file2);
141
    throws_ok { Koha::ERM::EHoldings::Title::read_file($file2); } 'Koha::Exceptions::FileNotParsed';
141
    }
142
    '2023, EIQ - QUO character not allowed, 157', 'Error message correctly reported';
143
};
142
};
144
143
145
subtest '_create_title_hash_from_line_data' => sub {
144
subtest '_create_title_hash_from_line_data' => sub {
146
- 

Return to bug 36942