Bug 21980 - Add some new Exceptions for Koha::Account methods
Summary: Add some new Exceptions for Koha::Account methods
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Martin Renvoize
QA Contact: Tomás Cohen Arazi
URL:
Keywords:
Depends on:
Blocks: 21002 21727
  Show dependency treegraph
 
Reported: 2018-12-10 11:51 UTC by Martin Renvoize
Modified: 2019-06-27 09:24 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 21980: Add new excpetions for Koha::Account (2.27 KB, patch)
2018-12-10 12:04 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 21980: Add new excpetions for Koha::Account (2.32 KB, patch)
2018-12-11 14:50 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 21980: Add new excpetions for Koha::Account (2.34 KB, patch)
2018-12-12 09:01 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 2018-12-10 11:51:35 UTC
We aren't validating as much as we should in the add_credit and upcoming add_debut and adjust methods in the Koha::Account classes.  This bug adds a couple of new exceptions for such cases.
Comment 1 Martin Renvoize 2018-12-10 12:04:55 UTC
Created attachment 83008 [details] [review]
Bug 21980: Add new excpetions for Koha::Account

He add two new exceptions here; One to be thrown when negative 'amount'
is passed into verious account methods that always expect positive
decimals and another to be thrown when a bad 'type' is passed into an
account method.
Comment 2 Martin Renvoize 2018-12-10 12:25:22 UTC
This patch was split out from bug 21002 to prevent 21002 from blocking bug 21727.  It is a trivial patch adding 2 new exceptions.
Comment 3 Tomás Cohen Arazi 2018-12-11 14:50:40 UTC
Created attachment 83046 [details] [review]
Bug 21980: Add new excpetions for Koha::Account

He add two new exceptions here; One to be thrown when negative 'amount'
is passed into verious account methods that always expect positive
decimals and another to be thrown when a bad 'type' is passed into an
account method.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Tomás Cohen Arazi 2018-12-11 14:53:42 UTC
This trivial enhancement can skip QA.
Comment 5 Martin Renvoize 2018-12-12 09:01:35 UTC
Created attachment 83085 [details] [review]
Bug 21980: Add new excpetions for Koha::Account

He add two new exceptions here; One to be thrown when negative 'amount'
is passed into verious account methods that always expect positive
decimals and another to be thrown when a bad 'type' is passed into an
account method.

Sponsored-by: PTFS Europe
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 6 Nick Clemens 2019-01-09 01:17:10 UTC
Awesome work all!

Pushed to master for 19.05
Comment 7 Martin Renvoize 2019-01-14 14:00:42 UTC
Enhancement, this will not be backported for 18.11.x at the moment.