Advertisement
Guest User

RaiseError

a guest
Oct 31st, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. local $dbh->{RaiseError} = 'on';
  2. local $dbh->{PrintWarn} = 'off';
  3. local $dbh->{PrintError} = 'off';
  4.  
  5. eval {
  6. $sth_ins->execute( $hd, $sz, $mtime, $_, $File::Find::dir, $dir );
  7. warn( "Added: ", $hd, " ", $mtime, " ", iso8601date($ctime), " ", $File::Find::name, "\n" )
  8. if $verbose > 1;
  9. $new++;
  10. };
  11.  
  12. if ( $@ ) {
  13. if ( $@ =~ /duplicate key.*"iuniq"/ ) {
  14. $dup++;
  15. }
  16. else {
  17. warn($@);
  18. }
  19. }
  20.  
  21. RESULT:
  22.  
  23. DBD::Pg::st execute failed: ERROR: duplicate key violates unique constraint "iuniq" at bin/mkindex line 161.
  24. Added: ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement