X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FHelper%2FActsAsList.pm;h=7ca63a353fde47542a4a3740076a770fa488190a;hb=08e48f66590f580cbe2c8e3df76883d88b4c0fef;hp=ee49f4aed2251e62d61d3c10e697e886c74ab98b;hpb=96670fe82a38116ac10592a6ccbd34800f8ad9f8;p=kivitendo-erp.git diff --git a/SL/DB/Helper/ActsAsList.pm b/SL/DB/Helper/ActsAsList.pm index ee49f4aed..7ca63a353 100644 --- a/SL/DB/Helper/ActsAsList.pm +++ b/SL/DB/Helper/ActsAsList.pm @@ -7,6 +7,7 @@ our @EXPORT = qw(move_position_up move_position_down add_to_list remove_from_lis get_previous_in_list get_next_in_list get_full_list); use Carp; +use SL::X; my %list_spec; @@ -142,10 +143,10 @@ sub reorder_list { my $column = column_name($self); my $result = $self->db->with_transaction(sub { my $query = qq|UPDATE | . $self->meta->table . qq| SET ${column} = ? WHERE id = ?|; - my $sth = $self->db->dbh->prepare($query) || die $self->db->dbh->errstr; + my $sth = $self->db->dbh->prepare($query) || SL::X::DBUtilsError->throw(msg => 'reorder_list error', db_error => $self->db->dbh->errstr); foreach my $new_position (1 .. scalar(@ids)) { - $sth->execute($new_position, $ids[$new_position - 1]) || die $sth->errstr; + $sth->execute($new_position, $ids[$new_position - 1]) || SL::X::DBUtilsError->throw(msg => 'reorder_list error', db_error => $sth->errstr); } $sth->finish;