Bug 37963: Case 2 - Consider providers returning error messages lower cased
Test plan:
1) Apply only test patch for case 1. Run tests:
prove t/db_dependent/Koha/BackgroundJob/ErmSushiHarvester.t
2) Verify tests fail. Apply the other patch for case 1.
3) Run tests again. Verify they now pass.
4) Repeat the test plan but using patches for case 2
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 23ab84c9b6)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
d4255bf632
commit
7baba70b69
|
|
@ -458,12 +458,16 @@ Additionally, adds background job report message(s) if that is the case
|
|||
sub _sushi_errors {
|
||||
my ( $self, $decoded_response ) = @_;
|
||||
|
||||
if ( $decoded_response->{Severity} ) {
|
||||
my $severity = $decoded_response->{Severity} // $decoded_response->{severity};
|
||||
my $message = $decoded_response->{Message} // $decoded_response->{message};
|
||||
my $code = $decoded_response->{Code} // $decoded_response->{code};
|
||||
|
||||
if ( $severity ) {
|
||||
$self->{job_callbacks}->{add_message_callback}->(
|
||||
{
|
||||
type => 'error',
|
||||
code => $decoded_response->{Code},
|
||||
message => $decoded_response->{Severity} . ' - ' . $decoded_response->{Message},
|
||||
code => $code,
|
||||
message => $severity . ' - ' . $message,
|
||||
}
|
||||
) if $self->{job_callbacks};
|
||||
return 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue