Bug 21134: Correctly throw the exception in Koha::Patron::Modification->approve

koha_1       |     # Looks like you planned 20 tests but ran 9.
koha_1       |
koha_1       | #   Failed test 'approve tests'
koha_1       | #   at t/db_dependent/Koha/Patron/Modifications.t line
259.
koha_1       | [Something went wrong]# Looks like your test exited with
255 just after 5.
koha_1       | [21:13:47] t/db_dependent/Koha/Patron/Modifications.t
.....................

"Something went wrong" should never been thrown,
Koha::Patron::Modification->approve raises $@, but it's not defined, it
should raise $_ instead

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2018-07-31 12:43:54 -03:00 committed by Tomas Cohen Arazi
parent a5492ce96b
commit 6e99cfbca7

View file

@ -146,7 +146,7 @@ sub approve {
Koha::Exceptions::Patron::Modification->throw( $_->{msg} );
}
else {
Koha::Exceptions::Patron::Modification->throw($@);
Koha::Exceptions::Patron::Modification->throw($_);
}
};
}