From 4f3ad7112f573c8da5e1670cb3ffc2fcc5953613 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 18 Mar 2021 12:07:00 -0300 Subject: [PATCH] Bug 27858: (follow-up) Consistency in stringified exception MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomas Cohen Arazi Signed-off-by: Joonas Kylmälä Signed-off-by: Jonathan Druart --- Koha/Exceptions/Patron/Attribute.pm | 4 ++-- t/Koha/Exceptions.t | 4 ++-- t/db_dependent/Koha/Patron/Attribute.t | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Koha/Exceptions/Patron/Attribute.pm b/Koha/Exceptions/Patron/Attribute.pm index fd9b70cd39..97785d6e2a 100644 --- a/Koha/Exceptions/Patron/Attribute.pm +++ b/Koha/Exceptions/Patron/Attribute.pm @@ -32,14 +32,14 @@ sub full_message { unless ( $msg) { if ( $self->isa('Koha::Exceptions::Patron::Attribute::NonRepeatable') ) { $msg = sprintf( - "Tried to add more than one non-repeatable attributes. code=%s attribute=%s", + "Tried to add more than one non-repeatable attributes. type=%s value=%s", $self->attribute->code, $self->attribute->attribute ); } elsif ( $self->isa('Koha::Exceptions::Patron::Attribute::UniqueIDConstraint') ) { $msg = sprintf( - "Your action breaks a unique constraint on the attribute. code=%s attribute=%s", + "Your action breaks a unique constraint on the attribute. type=%s value=%s", $self->attribute->code, $self->attribute->attribute ); diff --git a/t/Koha/Exceptions.t b/t/Koha/Exceptions.t index 4dbdc0c83c..908f6546a8 100755 --- a/t/Koha/Exceptions.t +++ b/t/Koha/Exceptions.t @@ -220,7 +220,7 @@ subtest 'Koha::Exceptions::Patron::Attribute::* tests' => sub { # stringify the exception is( "$@", - "Tried to add more than one non-repeatable attributes. code=$code attribute=$attribute", + "Tried to add more than one non-repeatable attributes. type=$code value=$attribute", 'Exception stringified correctly' ); @@ -244,7 +244,7 @@ subtest 'Koha::Exceptions::Patron::Attribute::* tests' => sub { # stringify the exception is( "$@", - "Your action breaks a unique constraint on the attribute. code=$code attribute=$attribute", + "Your action breaks a unique constraint on the attribute. type=$code value=$attribute", 'Exception stringified correctly' ); diff --git a/t/db_dependent/Koha/Patron/Attribute.t b/t/db_dependent/Koha/Patron/Attribute.t index 631279dbdf..b46d811374 100755 --- a/t/db_dependent/Koha/Patron/Attribute.t +++ b/t/db_dependent/Koha/Patron/Attribute.t @@ -91,9 +91,9 @@ subtest 'store() tests' => sub { is( "$@", - "Tried to add more than one non-repeatable attributes. code=" + "Tried to add more than one non-repeatable attributes. type=" . $attribute_type_2->{code} - . " attribute=Bar", + . " value=Bar", 'Exception stringified correctly, attribute passed correctly' ); @@ -164,9 +164,9 @@ subtest 'store() tests' => sub { is( "$@", - "Your action breaks a unique constraint on the attribute. code=" + "Your action breaks a unique constraint on the attribute. type=" . $attribute_type_2->{code} - . " attribute=Foo", + . " value=Foo", 'Exception stringified correctly, attribute passed correctly' ); -- 2.39.5