# connect with RaiseError set to true eval { $dbh->do('UPDATE a SET x = y'); $dbh->commit(); }; if ($@) { warn "flurg!: $@"; warn "flurg!: ", $dbh->errstr(); }