get_previous_in_list get_next_in_list get_full_list);
use Carp;
+use SL::X;
my %list_spec;
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;