$dbh->{RaiseError} = 1; eval { # do the whole DBI stuff }; if(my $e = $@) { confess("ERROR: What a pitty: Something went wrong: $e"); }