Browse Source

Bug 26171: (QA follow-up) Add table name and object type to message

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
21.05.x
Nick Clemens 3 years ago
committed by Jonathan Druart
parent
commit
0f7bbb64df
  1. 2
      Koha/Exceptions/Metadata.pm
  2. 2
      t/Koha/Exceptions.t

2
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 );
}
}

2
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" ) }

Loading…
Cancel
Save