Bug 27833: Make K::P::Attribute add the object to the exception
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 2 Mar 2021 14:10:12 +0000 (11:10 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 9 Apr 2021 13:43:26 +0000 (15:43 +0200)
commit35aefaa11c72f91d4d6d64d88389f3e33a91f4fc
tree40f30881bf91244af180a0793502165203803167
parente43ce6cc7f8d53c33b9263d7b4cf91e919fcc49f
Bug 27833: Make K::P::Attribute add the object to the exception

This patch makes the 'check_unique_id' and '_check_repeatable' methods
pass the 'attribute' parameter when throwing an exception. This way we
can provid emore meaningfull error messages.

To test:
1. Apply the previous patches
2. Run
   $ kshell
  k$ prove t/db_dependent/Koha/Patron/Attributes.t
=> FAIL: The exceptions are not passed the attribute!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/Patron/Attribute.pm