Bugzilla – Attachment 76894 Details for
Bug 21022
Exceptions should skip stringifying if message manually passed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21022: Use passed message if present
Bug-21022-Use-passed-message-if-present.patch (text/plain), 1.46 KB, created by
Jonathan Druart
on 2018-07-12 14:40:46 UTC
(
hide
)
Description:
Bug 21022: Use passed message if present
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-07-12 14:40:46 UTC
Size:
1.46 KB
patch
obsolete
>From 6d530ff9f72126a4ae106bd23d034b53e2ef4511 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 29 Jun 2018 11:02:57 -0300 >Subject: [PATCH] Bug 21022: Use passed message if present > >This patch makes 'full_message' use the passed exception message instead >of trying to build it from the parameters. This is particularly useful >for some situations in which we don't have all the information but would >like to keep using the same exception. > >To test: >- Apply this patchset >- Run: > $ kshell > k$ prove t/Koha/Exceptions.t >=> SUCCESS: Tests pass! >- Sign off > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > Koha/Exceptions/Exception.pm | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > >diff --git a/Koha/Exceptions/Exception.pm b/Koha/Exceptions/Exception.pm >index 6768587613..3b311b8322 100644 >--- a/Koha/Exceptions/Exception.pm >+++ b/Koha/Exceptions/Exception.pm >@@ -15,8 +15,10 @@ sub full_message { > > 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 ); >+ unless ( $msg) { >+ if ( $self->isa('Koha::Exceptions::Object::FKConstraint') ) { >+ $msg = sprintf("Invalid parameter passed, %s=%s does not exist", $self->broken_fk, $self->value ); >+ } > } > > return $msg; >-- >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 21022
:
76571
|
76572
|
76573
|
76889
|
76890
|
76891
|
76893
| 76894 |
76895