@Tobion DBAL 2.5 is throwing a specific exception for constraint violations, so this will help