]> git.koha-community.org Git - koha.git/commit
Bug 25032: Make existing controllers use unhandled_exception
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 2 Apr 2020 17:43:27 +0000 (14:43 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 29 Apr 2020 15:24:18 +0000 (16:24 +0100)
commitaf60dd912a1a3b732bce359b63cfd88a93217cd5
treec9297bf344ff32c5bd8f003b93b49f0361a81401
parent665d651e95145ed38e2a5c796c70bf7b43f48042
Bug 25032: Make existing controllers use unhandled_exception

This simple patch removes 'just in case' handling of specific exceptions
and makes the current routes controllers use the unhandled_exception helper.

Most possible exceptions are already catch by our tools (Koha::Object,
etc) and the existing code is not looking for known possible exceptions
but has just been copied and pasted since our beginings.

Anytime a situation in which an unhandled exception is caught, we (the
devs) should report it and specific exception handling discussed and
solved. But this has just been useless scaffolding so far.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/*.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1.
=> SUCCESS: Tests still pass
4. Sign off :-D

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 files changed:
Koha/Exceptions/ClubHold.pm
Koha/REST/V1/Acquisitions/Funds.pm
Koha/REST/V1/Acquisitions/Orders.pm
Koha/REST/V1/Acquisitions/Vendors.pm
Koha/REST/V1/Biblios.pm
Koha/REST/V1/Checkouts.pm
Koha/REST/V1/Cities.pm
Koha/REST/V1/Clubs/Holds.pm
Koha/REST/V1/Holds.pm
Koha/REST/V1/Items.pm
Koha/REST/V1/Libraries.pm
Koha/REST/V1/Patrons.pm
Koha/REST/V1/Patrons/Account.pm
Koha/REST/V1/Patrons/Password.pm
Koha/REST/V1/ReturnClaims.pm