| Summary: | Wrong error handling in Koha/Patron/Modification.pm hides a bug | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
| Component: | Test Suite | Assignee: | Jonathan Druart <jonathan.druart> |
| Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
| Severity: | normal | ||
| Priority: | P5 - low | CC: | fridolin.somers, martin.renvoize, tomascohen |
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | --- |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
| Bug Depends on: | 17767 | ||
| Bug Blocks: | |||
| Attachments: |
Bug 21134: Correctly throw the exception in Koha::Patron::Modification->approve
Bug 21134: Correctly throw the exception in Koha::Patron::Modification->approve |
||
|
Description
Jonathan Druart
2018-07-31 15:43:24 UTC
Created attachment 77342 [details] [review] 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 To test you can play with the following snippet:
use Koha::Exceptions::Patron::Modification;
use Try::Tiny;
try {
die "this is a specific error";
} catch {
Koha::Exceptions::Patron::Modification->throw($@);
};
then replace $@ with $_
Created attachment 77343 [details] [review] 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> Skipping QA for trivial patch. Pushed to 18.05.x for 18.05.03 Pushed to 17.11.x for 17.11.10 |