[Koha-bugs] [Bug 19841] AddMember should raise an exception if categorycode is invalid

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sat Dec 23 09:01:11 CET 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19841

--- Comment #9 from Josef Moravec <josef.moravec at gmail.com> ---
Created attachment 70148
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70148&action=edit
Bug 19841: Make AddMember raise an exception if categorycode is invalid

This patch makes C4::Members::AddMember raise a Koha::Exceptions::BadParameter
exception. The current behaviour is to just explode. Code calling
AddReturn should work as expected, unless they are looking for a
specific failure message.

It is just explodes in a way we know what happened, in the case the
categorycode is invalid.

To test:
- Apply the Unit tests patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Members.t
=> FAIL: Tests fail because AddReturn doesn't raise an exception
- Apply this patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Members.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: dom <dominic.pichette at inlibro.com>

Signed-off-by: Josef Moravec <josef.moravec at gmail.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list