Bug 23425: Display the MARCXML error in the Metadata::Invalid exception message
[srvgit] / Koha / Exceptions / Metadata.pm
index d9f55ef..887a49e 100644 (file)
@@ -25,7 +25,7 @@ use Exception::Class (
     'Koha::Exceptions::Metadata::Invalid' => {
         isa => 'Koha::Exceptions::Metadata',
         description => 'Invalid data',
-        fields => ['id','format','schema']
+        fields => ['id','format','schema', 'marcxml_error']
     }
 );
 
@@ -36,8 +36,8 @@ sub full_message {
 
     unless ($msg) {
         if ( $self->isa('Koha::Exceptions::Metadata::Invalid') ) {
-            $msg = sprintf( "Invalid data, cannot decode object (id=%s, format=%s, schema=%s)",
-                $self->id, $self->format, $self->schema );
+            $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 );
         }
     }