Bugzilla – Attachment 74556 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.17 KB, created by
Jonathan Druart
on 2018-04-19 13:51:08 UTC
(
hide
)
Description:
Bug 20590: Koha::Exceptions::Exception
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-04-19 13:51:08 UTC
Size:
1.17 KB
patch
obsolete
>From f7898c00fc9b26c914e9b908312d8cd424e866c3 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 > >--- > 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.11.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