Bugzilla – Attachment 119052 Details for
Bug 28056
Add Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28056: Add Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute
Bug-28056-Add-KohaExceptionsPatronMissingMandatory.patch (text/plain), 2.42 KB, created by
Martin Renvoize (ashimema)
on 2021-03-31 14:06:59 UTC
(
hide
)
Description:
Bug 28056: Add Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-03-31 14:06:59 UTC
Size:
2.42 KB
patch
obsolete
>From b428fd3024ba3a18ac342cf40bc9b080f6eae34f Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 30 Mar 2021 10:52:01 -0300 >Subject: [PATCH] Bug 28056: Add > Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute > >This trivial patch adds a new exception for more fine-grained control on >the errors when dealing with patrons and their extended attributes. > >To test: >1. Apply this patches >2. Run: > $ kshell > k$ prove t/Koha/Exceptions.t >=> SUCCESS: Tests pass! >3. Sign off :-D > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Exceptions/Patron.pm | 51 +++++++++++++++++++++++++++++++++++++++ > 1 file changed, 51 insertions(+) > >diff --git a/Koha/Exceptions/Patron.pm b/Koha/Exceptions/Patron.pm >index 069ed942c2..1bd51eb55e 100644 >--- a/Koha/Exceptions/Patron.pm >+++ b/Koha/Exceptions/Patron.pm >@@ -7,11 +7,62 @@ use Exception::Class ( > description => "Something went wrong!" > }, > 'Koha::Exceptions::Patron::FailedDelete' => { >+ isa => 'Koha::Exceptions::Patron', > description => "Deleting patron failed" > }, > 'Koha::Exceptions::Patron::FailedDeleteAnonymousPatron' => { >+ isa => 'Koha::Exceptions::Patron', > description => "Deleting patron failed, AnonymousPatron is not deleteable" > }, >+ 'Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute' => { >+ isa => 'Koha::Exceptions::Patron', >+ description => "Mandatory extended attribute missing", >+ fields => ['type'] >+ } > ); > >+sub full_message { >+ my $self = shift; >+ >+ my $msg = $self->message; >+ >+ unless ( $msg) { >+ if ( $self->isa('Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute') ) { >+ $msg = sprintf("Missing mandatory extended attribute (type=%s)", $self->type ); >+ } >+ } >+ >+ return $msg; >+} >+ >+=head1 NAME >+ >+Koha::Exceptions::Patron - Base class for patron exceptions >+ >+=head1 Exceptions >+ >+=head2 Koha::Exceptions::Patron >+ >+Generic patron exception. >+ >+=head2 Koha::Exceptions::Patron::FailedDelete >+ >+Deleting patron failed. >+ >+=head2 Koha::Exceptions::Patron::FailedDeleteAnonymousPatron >+ >+Tried to delete the anonymous patron. >+ >+=head2 Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute >+ >+A required mandatory extended attribute is missing. >+ >+=head1 Class methods >+ >+=head2 full_message >+ >+Overloaded method for exception stringifying. >+ >+=cut >+ > 1; >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28056
:
119007
|
119008
|
119051
|
119052
|
119072
|
119073