Help for this page
DBI->connect_cached( $dsn, $username, $auth, { PrintError => 1, RaiseError => 1, AutoInactiveDestroy => 1})or die "Could not connect to: " $DBI::er +rstr ."\n";
my $checkExist = $dbh->prepare("INSERT IGNORE INTO your statement here +"); if (!$checkExist->execute()) { die "Error: ". $checkExist->errstr ."\n"; }
use Try::Tiny; ... warn $_; # print the error (which Try::Tiny puts into $_) ... # do whatever you need to deal with the error };