Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
id => $self->id,
format => $self->format,
schema => $self->schema,
id => $self->id,
format => $self->format,
schema => $self->schema,
- marcxml_error => $marcxml_error,
+ decoding_error => $marcxml_error,
'Koha::Exceptions::Metadata::Invalid' => {
isa => 'Koha::Exceptions::Metadata',
description => 'Invalid data',
'Koha::Exceptions::Metadata::Invalid' => {
isa => 'Koha::Exceptions::Metadata',
description => 'Invalid data',
- fields => ['id','format','schema', 'marcxml_error']
+ fields => ['id','format','schema', 'decoding_error']
unless ($msg) {
if ( $self->isa('Koha::Exceptions::Metadata::Invalid') ) {
unless ($msg) {
if ( $self->isa('Koha::Exceptions::Metadata::Invalid') ) {
- $msg = sprintf( "Invalid data, cannot decode object (id=%s, format=%s, schema=%s, MARCXML error='%s')",
- $self->id, $self->format, $self->schema, $self->marcxml_error );
+ $msg = sprintf( "Invalid data, cannot decode object (id=%s, format=%s, schema=%s, decoding_error='%s')",
+ $self->id, $self->format, $self->schema, $self->decoding_error );
$object->mock( 'schema', 'a_schema' );
throws_ok
$object->mock( 'schema', 'a_schema' );
throws_ok
- { Koha::Exceptions::Metadata::Invalid->throw( id => 'an_id', format => 'a_format', schema => 'a_schema' ); }
+ { Koha::Exceptions::Metadata::Invalid->throw(
+ id => 'an_id', format => 'a_format',
+ schema => 'a_schema', decoding_error => 'a_nasty_error' ); }
'Koha::Exceptions::Metadata::Invalid',
'Exception is thrown :-D';
# stringify the exception
'Koha::Exceptions::Metadata::Invalid',
'Exception is thrown :-D';
# stringify the exception
- is( "$@", 'Invalid data, cannot decode object (id=an_id, format=a_format, schema=a_schema)', 'Exception stringified correctly' );
+ is( "$@", 'Invalid data, cannot decode object (id=an_id, format=a_format, schema=a_schema, decoding_error=\'a_nasty_error\')', 'Exception stringified correctly' );
throws_ok
{ Koha::Exceptions::Metadata::Invalid->throw( "Manual message exception" ) }
throws_ok
{ Koha::Exceptions::Metadata::Invalid->throw( "Manual message exception" ) }