View | Details | Raw Unified | Return to bug 23425
Collapse All | Expand All

(-)a/Koha/Biblio/Metadata.pm (-1 / +4 lines)
Lines 68-78 sub record { Link Here
68
68
69
    if ( $self->format eq 'marcxml' ) {
69
    if ( $self->format eq 'marcxml' ) {
70
        $record = eval { MARC::Record::new_from_xml( $self->metadata, 'utf-8', $self->schema ); };
70
        $record = eval { MARC::Record::new_from_xml( $self->metadata, 'utf-8', $self->schema ); };
71
        my $marcxml_error = $@;
72
        chomp $marcxml_error;
71
        unless ($record) {
73
        unless ($record) {
72
            Koha::Exceptions::Metadata::Invalid->throw(
74
            Koha::Exceptions::Metadata::Invalid->throw(
73
                id     => $self->id,
75
                id     => $self->id,
74
                format => $self->format,
76
                format => $self->format,
75
                schema => $self->schema
77
                schema => $self->schema,
78
                marcxml_error => $marcxml_error,
76
            );
79
            );
77
        }
80
        }
78
    }
81
    }
(-)a/Koha/Exceptions/Metadata.pm (-4 / +3 lines)
Lines 25-31 use Exception::Class ( Link Here
25
    'Koha::Exceptions::Metadata::Invalid' => {
25
    'Koha::Exceptions::Metadata::Invalid' => {
26
        isa => 'Koha::Exceptions::Metadata',
26
        isa => 'Koha::Exceptions::Metadata',
27
        description => 'Invalid data',
27
        description => 'Invalid data',
28
        fields => ['id','format','schema']
28
        fields => ['id','format','schema', 'marcxml_error']
29
    }
29
    }
30
);
30
);
31
31
Lines 36-43 sub full_message { Link Here
36
36
37
    unless ($msg) {
37
    unless ($msg) {
38
        if ( $self->isa('Koha::Exceptions::Metadata::Invalid') ) {
38
        if ( $self->isa('Koha::Exceptions::Metadata::Invalid') ) {
39
            $msg = sprintf( "Invalid data, cannot decode object (id=%s, format=%s, schema=%s)",
39
            $msg = sprintf( "Invalid data, cannot decode object (id=%s, format=%s, schema=%s, MARCXML error='%s')",
40
                $self->id, $self->format, $self->schema );
40
                $self->id, $self->format, $self->schema, $self->marcxml_error );
41
        }
41
        }
42
    }
42
    }
43
43
44
- 

Return to bug 23425