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> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
7130267d64
commit
220a9adea9
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue