Bug 26518: Raise exception if the insert failed
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
a1e9453f1d
commit
b0c39296c5
|
|
@ -240,6 +240,7 @@ sub AddBiblio {
|
|||
}
|
||||
)->store;
|
||||
$biblionumber = $biblio->biblionumber;
|
||||
Koha::Exceptions::ObjectNotCreated->throw unless $biblio;
|
||||
|
||||
my ($cn_sort) = GetClassSort( $olddata->{'biblioitems.cn_source'}, $olddata->{'cn_class'}, $olddata->{'cn_item'} );
|
||||
my $biblioitem = Koha::Biblioitem->new(
|
||||
|
|
@ -276,6 +277,7 @@ sub AddBiblio {
|
|||
agerestriction => $olddata->{agerestriction},
|
||||
}
|
||||
)->store;
|
||||
Koha::Exceptions::ObjectNotCreated->throw unless $biblioitem;
|
||||
$biblioitemnumber = $biblioitem->biblioitemnumber;
|
||||
|
||||
_koha_marc_update_bib_ids( $record, $frameworkcode, $biblionumber, $biblioitemnumber );
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@ use Exception::Class (
|
|||
isa => 'Koha::Exceptions::Exception',
|
||||
description => 'The required object doesn\'t exist',
|
||||
},
|
||||
'Koha::Exceptions::ObjectNotCreated' => {
|
||||
isa => 'Koha::Exceptions::Exception',
|
||||
description => 'The object have not been created',
|
||||
},
|
||||
'Koha::Exceptions::CannotDeleteDefault' => {
|
||||
isa => 'Koha::Exceptions::Exception',
|
||||
description => 'The default value cannot be deleted'
|
||||
|
|
|
|||
Loading…
Reference in New Issue