From 23bdea8bb786b9da551abb362581aa23ecbeedc9 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 21 Dec 2020 19:24:05 +0000 Subject: [PATCH] Bug 26171: (QA follow-up) Add table name and object type to message Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart (cherry picked from commit 0f7bbb64df376cd0998d6e882ad2f0a699187863) Signed-off-by: Fridolin Somers (cherry picked from commit 4e18ae84b11a74bf24398a9fb848a6ab2cd82c74) Signed-off-by: Andrew Fuerste-Henry --- Koha/Exceptions/Metadata.pm | 2 +- t/Koha/Exceptions.t | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/Exceptions/Metadata.pm b/Koha/Exceptions/Metadata.pm index 78dadae348..8c95fa0556 100644 --- a/Koha/Exceptions/Metadata.pm +++ b/Koha/Exceptions/Metadata.pm @@ -36,7 +36,7 @@ sub full_message { unless ($msg) { if ( $self->isa('Koha::Exceptions::Metadata::Invalid') ) { - $msg = sprintf( "Invalid data, cannot decode object (id=%s, biblionumber=%s, format=%s, schema=%s, decoding_error='%s')", + $msg = sprintf( "Invalid data, cannot decode metadata object (biblio_metadata.id=%s, biblionumber=%s, format=%s, schema=%s, decoding_error='%s')", $self->id, $self->biblionumber, $self->format, $self->schema, $self->decoding_error ); } } diff --git a/t/Koha/Exceptions.t b/t/Koha/Exceptions.t index 1a98779429..5cd3f1cfff 100644 --- a/t/Koha/Exceptions.t +++ b/t/Koha/Exceptions.t @@ -123,7 +123,7 @@ subtest 'Koha::Exceptions::Metadata tests' => sub { 'Exception is thrown :-D'; # stringify the exception - is( "$@", 'Invalid data, cannot decode object (id=an_id, biblionumber=a_biblionumber, format=a_format, schema=a_schema, decoding_error=\'a_nasty_error\')', 'Exception stringified correctly' ); + is( "$@", 'Invalid data, cannot decode metadata object (biblio_metadata.id=an_id, biblionumber=a_biblionumber, format=a_format, schema=a_schema, decoding_error=\'a_nasty_error\')', 'Exception stringified correctly' ); throws_ok { Koha::Exceptions::Metadata::Invalid->throw( "Manual message exception" ) } -- 2.39.5