Bugzilla – Attachment 74561 Details for
Bug 20590
Koha::Exceptions does not stringify the exceptions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20590: Koha::Exceptions::Exception
Bug-20590-KohaExceptionsException.patch (text/plain), 1.22 KB, created by
Tomás Cohen Arazi (tcohen)
on 2018-04-19 14:26:23 UTC
(
hide
)
Description:
Bug 20590: Koha::Exceptions::Exception
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2018-04-19 14:26:23 UTC
Size:
1.22 KB
patch
obsolete
>From ed0bab07578c9723f1b1e2764dd2ff4d6c7a18ee Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 19 Apr 2018 10:50:33 -0300 >Subject: [PATCH] Bug 20590: Koha::Exceptions::Exception > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Exceptions/Exception.pm | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > create mode 100644 Koha/Exceptions/Exception.pm > >diff --git a/Koha/Exceptions/Exception.pm b/Koha/Exceptions/Exception.pm >new file mode 100644 >index 0000000000..6768587613 >--- /dev/null >+++ b/Koha/Exceptions/Exception.pm >@@ -0,0 +1,25 @@ >+package Koha::Exceptions::Exception; >+ >+use Modern::Perl; >+ >+# Looks like this class should be more Koha::Exception::Base; >+use Exception::Class ( >+ 'Koha::Exceptions::Exception' => { >+ description => "Something went wrong!" >+ }, >+); >+ >+# We want to overload it to have a stringification method for our exceptions >+sub full_message { >+ my $self = shift; >+ >+ my $msg = $self->message; >+ >+ if ( $self->isa('Koha::Exceptions::Object::FKConstraint') ) { >+ $msg = sprintf("Invalid parameter passed, %s=%s does not exist", $self->broken_fk, $self->value ); >+ } >+ >+ return $msg; >+} >+ >+1; >-- >2.17.0
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 20590
:
74246
|
74556
|
74560
| 74561 |
74562
|
74563
|
74583
|
74639